Home | History | Annotate | Line # | Download | only in debian
rules revision 1.1.1.6.2.1
      1 #!/usr/bin/make -f
      2 # Made with the aid of dh_make, by Craig Small
      3 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
      4 # Some lines taken from debmake, by Cristoph Lameter.
      5 
      6 # Uncomment this to turn on verbose mode.
      7 #export DH_VERBOSE=1
      8 
      9 # These are used for cross-compiling and for saving the configure script
     10 # from having to guess our platform (since we know it already)
     11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
     12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
     13 
     14 DESKTOP_VENDOR  = dickey
     15 
     16 PKG_SUFFIX	= -dev
     17 PKG_CLASS	= XTermDev
     18 
     19 PACKAGE		:= $(shell dpkg-parsechangelog| \
     20 			sed -n 's/^Source: \(.*\)$$/\1/p')
     21 
     22 PKG_APPDEFAULTS	:= /etc/X11/app-defaults
     23 PKG_DESKTOP	:= /usr/share/applications
     24 
     25 DSTDIR		:= $(CURDIR)/debian/$(PACKAGE)
     26 MY_DESKTOP	:= $(DSTDIR)/usr/share/applications
     27 
     28 CPPFLAGS	:= $(shell dpkg-buildflags --get CPPFLAGS)
     29 CFLAGS		:= $(shell dpkg-buildflags --get CFLAGS)
     30 LDFLAGS		:= $(shell dpkg-buildflags --get LDFLAGS)
     31 
     32 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
     33 DEBOP=--enable-debug
     34 else
     35 DEBOP=
     36 endif
     37 
     38 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
     39         CFLAGS += -O0
     40 else
     41         CFLAGS += -O2
     42 endif
     43 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
     44         INSTALL_PROGRAM += -s
     45 endif
     46 
     47 configure: configure-stamp
     48 configure-stamp:
     49 	dh_testdir
     50 
     51 	CPPFLAGS="$(CPPFLAGS)" \
     52 	CFLAGS="$(CFLAGS)" \
     53 	LDFLAGS="$(LDFLAGS)" \
     54 	./configure \
     55 		--host=$(DEB_HOST_GNU_TYPE) \
     56 		--build=$(DEB_BUILD_GNU_TYPE) \
     57 		--program-suffix=$(PKG_SUFFIX) \
     58 		--prefix=/usr \
     59 		--libexecdir=\$${prefix}/lib \
     60 		--mandir=\$${prefix}/share/man \
     61 		--sysconfdir=/etc/$(PACKAGE) \
     62 		--localstatedir=/var \
     63 		--libdir=/etc/$(PACKAGE) \
     64 		--with-app-class=$(PKG_CLASS) \
     65 		--without-xterm-symlink \
     66 		--disable-imake \
     67 		--enable-dabbrev \
     68 		--enable-dec-locator \
     69 		--enable-double-buffer \
     70 		--enable-exec-xterm \
     71 		--enable-hp-fkeys \
     72 		--enable-load-vt-fonts \
     73 		--enable-logfile-exec \
     74 		--enable-logging \
     75 		--enable-mini-luit \
     76 		--enable-regis-graphics \
     77 		--enable-sco-fkeys \
     78 		--enable-toolbar \
     79 		--enable-xmc-glitch \
     80 		--with-app-defaults=$(PKG_APPDEFAULTS) \
     81 		--with-icondir=\$${prefix}/share/icons \
     82 		--with-pixmapdir=\$${prefix}/share/pixmaps \
     83 		--with-own-terminfo=\$${prefix}/share/terminfo \
     84 		--with-icon-theme \
     85 		--with-terminal-type=xterm-new \
     86 		--with-utempter \
     87 		--with-icon-name=mini.xterm \
     88 		--with-xpm ${DEBOP}
     89 
     90 	touch configure-stamp
     91 
     92 build: build-stamp
     93 build-stamp: configure-stamp
     94 	dh_testdir
     95 
     96 	$(MAKE)
     97 
     98 	touch build-stamp
     99 
    100 clean:
    101 	dh_testdir
    102 	dh_testroot
    103 
    104 	[ ! -f Makefile ] || $(MAKE) distclean
    105 
    106 	dh_clean
    107 
    108 install: install-stamp
    109 install-stamp: build-stamp
    110 	dh_testdir
    111 	dh_testroot
    112 	dh_clean -k
    113 	dh_installdirs
    114 
    115 	$(MAKE) install \
    116 		DESTDIR=$(CURDIR)/debian/$(PACKAGE)
    117 
    118 	touch install-stamp
    119 
    120 install: install-indep install-arch
    121 install-indep:
    122 
    123 install-arch:
    124 	dh_testdir
    125 	dh_testroot
    126 	dh_prep -s 
    127 	dh_installdirs -s
    128 
    129 	$(MAKE) install-bin \
    130 		DESTDIR=$(DSTDIR)
    131 
    132 # Build architecture-independent files here.
    133 binary-indep: build install
    134 	dh_testdir
    135 	dh_testroot
    136 
    137 	# This overwrites the Debian package's copy of app-defaults and icons.
    138 	# But the resources are not the same; they are patched.
    139 	sed -i -f package/debian/color.sed XTerm-col.ad
    140 	sed -i -f package/debian/xterm-xres.sed XTerm.ad
    141 
    142 	$(MAKE) install-app \
    143 		install-icon \
    144 		install-man \
    145 		DESTDIR=$(DSTDIR)
    146 
    147 	# Follow-up with a check against the installed resource files.
    148 	( cd $(DSTDIR)$(PKG_APPDEFAULTS) \
    149 	  && $(SHELL) -c 'for p in *; do \
    150 	  	test -f $(PKG_APPDEFAULTS)/$$p && \
    151 	  	diff -u $(PKG_APPDEFAULTS)/$$p $$p; \
    152 		done' ; \
    153 	  exit 0 )
    154 
    155 	# The Debian package stopped installing xterm's desktop files; a
    156 	# subsequent revision added that back with limitations.  xterm's
    157 	# configure script checks for categories which are used by other
    158 	# terminal emulators.  The Debian package overrides that to a single
    159 	# category.
    160 	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486317
    161 	$(MAKE) install-desktop \
    162 		DESKTOP_FLAGS="--dir $(MY_DESKTOP)"
    163 
    164 	( cd $(DSTDIR)$(PKG_DESKTOP) \
    165 	  && $(SHELL) -c 'for p in *;do \
    166 	  	test -f $(PKG_DESKTOP)/$$p && \
    167 		diff -u $(PKG_DESKTOP)/$$p $$p; \
    168 	  	test -n "$(PKG_SUFFIX)" && mv $$p `basename $$p .desktop`$(PKG_SUFFIX).desktop; \
    169 		done' ; \
    170 	  exit 0 )
    171 
    172 	dh_icons
    173 
    174 # Build architecture-dependent files here.
    175 binary-arch: build install
    176 	dh_testdir
    177 	dh_testroot
    178 	dh_installdebconf
    179 	dh_lintian
    180 	dh_installdocs
    181 	dh_installmenu
    182 	dh_installmime
    183 	dh_installexamples tektests vttests
    184 	dh_installchangelogs
    185 	dh_install
    186 	dh_link
    187 	dh_strip
    188 	dh_compress -Xexamples
    189 	dh_fixperms
    190 	dh_installdeb
    191 	dh_shlibdeps
    192 	dh_gencontrol
    193 	dh_md5sums
    194 	dh_builddeb
    195 
    196 binary: binary-indep binary-arch
    197 .PHONY: build clean binary-indep binary-arch binary install install-stamp
    198