summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 69559e81e14d8d913cd84f2b1ec2442c8d5e6c2f (plain)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/usr/bin/make -f
# rules to package GIMP-Print
# $Id: rules,v 1.29 2001/11/24 14:59:46 sharkey Exp $
#
# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
export DH_COMPAT=2

# This has to be exported to make some magic below work.
export DH_OPTIONS

# Get upstream version, and define libgimpprint suffix
UPSTREAM_VERSION = $(shell dpkg-parsechangelog | grep ^Version | sed "s/.* //" | sed "s/-[^-]*$$//")
#LIBRARY_VERSION = $(UPSTREAM_VERSION)
LIBRARY_VERSION = 1

build: build-stamp debian/control
build-stamp: configure
	dh_testdir
	
	cd debian ; \
	ln -sf libgimpprint.files libgimpprint$(LIBRARY_VERSION).files ; \
	ln -sf libgimpprint.postinst libgimpprint$(LIBRARY_VERSION).postinst ; \
	cd .. ; \
	mkdir debian/gimp-print-build ; \
	cd debian/gimp-print-build ; \
	BUILD_PACKAGE=true ../../configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-static --enable-shared --without-gimp --with-cups --disable-test --without-translated-ppds --disable-cups-level3-ps --enable-maintainer-mode ; \
	$(MAKE) ; \
	cd src/gimp ; \
	$(MAKE) print

	touch build-stamp

clean: debian/control
	dh_testdir
	rm -f build-stamp 

	# Add here commands to clean up after the build process.
	rm -rf debian/gimp-print-build debian/gimp-print-install
	rm -rf debian/libgimpprint$(LIBRARY_VERSION).files
	rm -rf debian/libgimpprint$(LIBRARY_VERSION).postinst
	-$(MAKE) distclean

	dh_clean

install: DH_OPTIONS=
install: build debian/control
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	cd debian/gimp-print-build ; \
	$(MAKE) DESTDIR=`pwd`/../gimp-print-install install
	
	scripts/mkinstalldirs debian/gimp1.2-print/usr/lib/gimp/1.2/plug-ins
	/usr/bin/install -c debian/gimp-print-build/src/gimp/.libs/print debian/gimp1.2-print/usr/lib/gimp/1.2/plug-ins/print
	
	dh_movefiles --sourcedir=debian/gimp-print-install


# Build architecture-independent files here.
binary-indep: build install ChangeLog
	dh_testdir -i
	dh_testroot -i
#	dh_installdebconf -i
	dh_installdocs -i
	  cp debian/gimp-print-build/doc/gimpprint.ps debian/libgimpprint-doc/usr/share/doc/libgimpprint-doc
	  cp -r debian/gimp-print-build/doc/manual-html debian/libgimpprint-doc/usr/share/doc/libgimpprint-doc/html
	  cd debian/libgimpprint-doc/usr/share/doc/libgimpprint-doc/html ; \
	  if test ! -f gimpprint.html ; then \
	    ln -s gimpprint_toc.html gimpprint.html ; \
	  fi
	cp debian/gimp-print-build/doc/users_guide/*.pdf debian/gimpprint-doc/usr/share/doc/gimpprint-doc
	cp -r debian/gimp-print-build/doc/users_guide/html debian/gimpprint-doc/usr/share/doc/gimpprint-doc/html
	dh_installexamples -i
#	dh_installmenu -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_installmanpages -i
	dh_installinfo -i -plibgimpprint-doc debian/gimp-print-install/usr/share/info/*
	dh_undocumented -i
	dh_installchangelogs -i NEWS
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
#	dh_perl -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install ChangeLog
	dh_testdir -a
	dh_testroot -a
#	dh_installdebconf -a
	dh_installdocs -a
	  cp src/cups/README debian/cupsys-driver-gimpprint/usr/share/doc/cupsys-driver-gimpprint/README.cups
	  mkdir debian/gimp1.2-print/usr/share/doc/gimp1.2-print/html ; \
	  cp doc/*.html doc/*.png debian/gimp1.2-print/usr/share/doc/gimp1.2-print/html ; \
	dh_installexamples -a
	  mkdir -p debian/gimp1.2-print/usr/share/doc/gimp1.2-print/samples
	  cp -r samples/*.png debian/gimp1.2-print/usr/share/doc/gimp1.2-print/samples
	  mkdir -p debian/cupsys-driver-gimpprint/usr/share/doc/cupsys-driver-gimpprint/samples
	  cp -r samples/profile.jpg debian/cupsys-driver-gimpprint/usr/share/doc/cupsys-driver-gimpprint/samples
#	dh_installmenu -a
#	dh_installlogrotate -a
#	dh_installemacsen -a
#	dh_installpam -a
#	dh_installmime -a
#	dh_installinit -a
#	dh_installcron -a
#	dh_installmanpages -a
#	dh_installinfo -a
#	dh_undocumented -a
	dh_installchangelogs -a NEWS
	dh_strip -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
#	dh_perl -a
	dh_shlibdeps -a -l`pwd`/debian/libgimpprint$(LIBRARY_VERSION)/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

# Make sure ChangeLog is up-to-date.
ChangeLog: changelog-stamp
changelog-stamp: build
	$(MAKE) ChangeLog
	
# Make sure an/that  is up-to-date.
debian/control: debian/changelog debian/control.in
	sed -e "s/#UPSTREAM_VERSION#/$(UPSTREAM_VERSION)/g" <debian/control.in >debian/control

# Make sure that configure is up-to-date.
configure: configure.in scripts/install-sh
	if test -f configure.in ; then \
	  if test -f autogen.sh ; then \
	    export NOCONFIGURE=TRUE ; \
	    /bin/sh autogen.sh ; \
	  fi \
	fi
	
configure.in: configure.in.in
	if test -f configure.in.in ; then \
	  if test -f autogen.sh ; then \
	    export NOCONFIGURE=TRUE ; \
	    /bin/sh autogen.sh ; \
	  fi \
	fi

scripts/install-sh:
	if test -f autogen.sh ; then \
	  export NOCONFIGURE=TRUE ; \
	  /bin/sh autogen.sh ; \
	fi

configure.in.in:

.PHONY: build clean binary-indep binary-arch binary install NEWS