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