-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.j-pkg
97 lines (85 loc) · 2.84 KB
/
Makefile.j-pkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#
# j-pkg.mk - common Makefile.pkg-based build system
# Copyright (C) 2004-2006 Jeremy Laine <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Changes
# 2006-01-14 : v1.5
# * Move to j-pkg.mk
#
# 2006-01-03 : v1.4
# * Fix broken multiline sed calls
#
# 2005-12-05 : v1.3
# * Add LyX backup files to CLEANFILES
#
# 2005-11-05 : v1.2
# * Support HtmlUrl element for manpages
# * Add KDevelop backup files to CLEANFILES
# * Initialise my_* variables
#
my_BUILDVERSION = 1.4
my_PKGDOCDIR = $(prefix)/share/doc/$(my_PKGNAME)
my_PKGDATADIR = $(prefix)/share/$(my_PKGNAME)
my_USERCONFIG = .$(my_PKGNAME)rc
my_NOINSTFILES =
my_INSTFILES =
my_CLEANFILES =
my_EXTRA_DIST =
noinst_DATA = $(my_INSTFILES) $(my_NOINSTFILES)
EXTRA_DIST = $(my_EXTRA_DIST) $(my_INSTFILES)
CLEANFILES = $(my_CLEANFILES) *.c~ *.cpp~ *.css~ *.h~ *.lyx~ *.php~ *.pl~ *.pm~ *.t~ *.tpl~
#
# variable substitutions
#
%: %.in
sed -e 's,\@PACKAGE\@,$(my_PKGNAME),g' \
-e 's,\@VERSION\@,@VERSION@,g' \
-e 's,\@USERCONFIG\@,$(my_USERCONFIG),g' \
-e 's,\@PERLMOD\@,@PERLMOD@,g' \
-e 's,\@datadir\@,$(my_PKGDATADIR),g' \
-e 's,\@docdir\@,$(my_PKGDOCDIR),g' $< > $@
if [ -n "$(findstring $@,$(bin_SCRIPTS))" ]; then chmod +x $@; fi
#
# man from SGML generation
#
%.tmp.lyx: %.lyx
cp $< $@
%.sgml: %.tmp.lyx
lyx-qt -e linuxdoc $^
mv $*.tmp.sgml $@
%.1: %.sgml
cat $< | sed -e 's/<htmlurl url=\"\([^\"]*\)\" name=.*>/<em>\1<\/em>/g' > $(<:%.sgml=%.tmp.sgml)
linuxdoc -B txt -m $(<:%.sgml=%.tmp.sgml)
mv -f $(<:%.sgml=%.tmp.man) $@
rm -f $(<:%.sgml=%.tmp.sgml)
%.html: %.sgml
linuxdoc -B html -T 0 $<
cat $(@:%.html=%-1.html) | grep -v $@ | grep -v ^Next | grep -v ^Previous | grep -v "^<HR>" > $@
rm -f $(@:%.html=%-1.html)
#
# install and uninstall
#
install-data-local: $(my_INSTFILES)
if [ -n "$(my_INSTDIR)" ]; then mkdir -p $(DESTDIR)$(my_INSTDIR); fi
@list='$(my_INSTFILES)'; for myfile in $$list; do \
$(INSTALL_DATA) $(srcdir)/$$myfile $(DESTDIR)$(my_INSTDIR); \
done
uninstall-local:
@list='$(my_INSTFILES)'; for myfile in $$list; do \
rm -f $(DESTDIR)$(my_INSTDIR)/$$myfile; \
done
-if [ -n "$(my_INSTDIR)" ]; then rmdir $(DESTDIR)$(my_INSTDIR); fi