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
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Also some stuff taken from debmake scripts, by Cristopt Lameter.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
#version := $(shell grep ^VERSION Makefile | cut -d" " -f3)
version := $(shell perl -ne 'if (/AC_INIT\(gri, ([0-9.]+)\)/){print $$1}' configure.ac)
somefutureversion=2.14.0
CXXFLAGS = -O2 -Wall
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CXXFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
STRIPIT=1
endif
ARCH := $(shell dpkg --print-architecture | perl -pe chop)
build: build-indep build-arch
# Build architecture-dependent files here (no need to be root).
build-arch: debian/copyright gri
cd doc; make info
gri: Makefile
dh_testdir
ifeq ($(ARCH),m68k)
cd src; make CXXFLAGS="-O0 -Wall" rpncalc.o
endif
cd src; make CXXFLAGS=${CXXFLAGS}
clean:
dh_testdir
dh_testroot
[ ! -f Makefile ] || $(MAKE) distclean
mv doc/FAQ.html doc/FAQ.html.KEEP
-rm -f config.log config.status debian/Makefile doc/*.html
-rm -f doc/gri.info* doc/*.dvi doc/*.ps doc/*.pdf doc/*.log doc/html
-rm src/gri.cmd src/startup.msg-tmp
mv doc/FAQ.html.KEEP doc/FAQ.html
dh_clean
rm -fR debian/gri-$(version)static
rm -f debian/README.Debian debian/gri.1 debian/copyright
rm -f doc/gri_unpage.1 doc/gri_merge.1
chmod u+w debian/changelog
install: gri
dh_testdir
dh_testroot
dh_prep
dh_installdirs
cd src; make install_linux_debian debian=`pwd`/../debian/gri
debian/copyright:
sed -e 's/VSN/$(version)/g' \
debian/copyright.template > debian/copyright
sed -e 's/LATERVSN/$(somefutureversion)/g;s/VSN/$(version)/g' \
debian/gri.man > debian/gri.1
sed -e 's/LATERVSN/$(somefutureversion)/g;s/VSN/$(version)/g' \
debian/README.Debian.template > debian/README.Debian
cp doc/gri_unpage.1-skel doc/gri_unpage.1
cp doc/gri_merge.1-skel doc/gri_merge.1
Makefile:
# To test on g++-3.0 :
# CC=gcc-3.0 CXX=g++-3.0 ./configure --prefix=/usr
./configure --prefix=/usr --enable-linux_debian
# Build architecture-independent files here (no need to be root).
build-indep: debian/copyright Makefile
cd doc; make refcard.ps cmdrefcard.ps gri.pdf html
# Install (as root) architecture-independent files here.
binary-indep: build-indep
dh_testdir -i
dh_testroot -i
install -d debian/gri-el/usr/share/emacs/site-lisp/gri-el
install -m 644 src/gri-mode.el debian/gri-el/usr/share/emacs/site-lisp/gri-el
install -d debian/gri-pdf-doc/usr/share/doc/gri
install -m 644 doc/gri.pdf debian/gri-pdf-doc/usr/share/doc/gri
install -m 644 doc/refcard.ps debian/gri-pdf-doc/usr/share/doc/gri
install -m 644 doc/cmdrefcard.ps debian/gri-pdf-doc/usr/share/doc/gri
cd doc; make html-install DESTDIR=`pwd`/../debian/gri-html-doc/
rm -f debian/*debhelper
dh_installdocs -i -A README debian/README.Debian
dh_installexamples -i
dh_installemacsen -i
dh_installchangelogs -i
dh_compress -i -X.jpg -Xlogo.gri
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Install (as root) architecture-dependent files here.
binary-arch: build-arch install
dh_testdir -a
dh_testroot -a
(cd debian/gri/usr/share/gri/$(version) ; ln -fs ../../common-licenses/GPL license.txt)
rm -f debian/*debhelper
dh_installdocs -a README
dh_installexamples -a
dh_installemacsen -a
dh_installinfo doc/gri.info*
dh_installman debian/gri.1 doc/gri_unpage.1 doc/gri_merge.1
(cd debian/gri/usr/share/man/man1 ; ln -fs gri.1.gz gri-$(version).1.gz)
dh_installchangelogs -a
ifdef STRIPIT
dh_strip -a
endif
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
# This is a target that developers won't use. I use it to create
# non-Debian Gri packages that contain a specific version of Gri for use
# alongside other (newer) versions of Gri.
# See README.Debian.unofficial
binary-arch-unofficial: debian/copyright build-arch
rm -f debian/*debhelper
rm -rf debian/gri-$(version) debian/gri-$(version)static
-cp debian/control debian/control.real
sed -e 's/VSN/$(version)/g' debian/control.unofficial > debian/control
-cp debian/README.Debian debian/README.Debian.real
-cp debian/README.Debian.unofficial debian/README.Debian
cd src; make install_linux_debian_grionly debian=../debian/gri-$(version)
(cd debian/gri-$(version)/usr/share/gri/$(version) ; ln -s ../../common-licenses/GPL license.txt)
cd src; mv gri gri.real
-rm debian/substvars
make LIBS="-lm -L/usr/lib/netcdf -lnetcdf -static"
cd src; make install_linux_debian_grionly debian=../debian/gri-$(version)static
(cd debian/gri-$(version)static/usr/share/gri/$(version) ; ln -s ../../common-licenses/GPL license.txt)
cd src; mv gri.real gri
dh_testdir -a
dh_testroot -a
dh_installdocs -a -A README debian/README.Debian
install -d debian/gri-$(version)/usr/share/man/man1
install debian/gri.1 debian/gri-$(version)/usr/share/man/man1/gri-$(version).1
install -d debian/gri-$(version)static/usr/share/man/man1
install debian/gri.1 debian/gri-$(version)static/usr/share/man/man1/gri-$(version).1
# dh_installmanpages -a doc/gri*.1 debian/gri.1
# -rm debian/gri-$(version).1
dh_installchangelogs -a
ifdef STRIPIT
dh_strip -a
endif
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
-mv debian/control.real debian/control
-mv debian/README.Debian.real debian/README.Debian
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
|