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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
# modified by Gopal Narayanan <gopal@debian.org> to use
# debhelper commands
package=pgplot
npackage=pgplot5
version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
vm=$(version_major)
curdir=$(shell pwd)
bdir=debian/builddir
packagedir=debian/$(npackage)
INSTALL =/usr/bin/install
GZIP =/bin/gzip
INSTALL_DATA =$(INSTALL) -m644 -o root -g root
INSTALL_STRIP =$(INSTALL) -m755 -o root -g root -s
GZIP_DATA =$(GZIP) -9
INSTALL_DIR = $(INSTALL) -d -m755 -o root -g root
# Decide if changes for 64 bit systems need to be made
#
64-BIT_BUILD_STAMP =
64-BIT_CLEAN_STAMP =
ifeq (64,$(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS))
64-BIT_BUILD_STAMP = 64-bit-patch-stamp
64-BIT_CLEAN_STAMP = 64-bit-clean-stamp
endif
# Construct the library dependency entry for shlibs
#
shl1=lib$(package) $(vm) pgplot5 (>= $(version))
# Restore 32-bit files
#
64-bit-clean-stamp:
mv debian/gidriv.f drivers/gidriv.f
mv debian/ppdriv.f drivers/ppdriv.f
mv debian/wddriv.f drivers/wddriv.f
rm 64-bit-patch-stamp
# Move 64-bit-safe files into position
#
64-bit-patch-stamp:
mv drivers/gidriv.f debian/gidriv.f
cp debian/gidriv_64.f drivers/gidriv.f
mv drivers/ppdriv.f debian/ppdriv.f
cp debian/ppdriv_64.f drivers/ppdriv.f
mv drivers/wddriv.f debian/wddriv.f
cp debian/wddriv_64.f drivers/wddriv.f
touch 64-bit-patch-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: $(64-BIT_BUILD_STAMP)
dh_testdir
# create the build directory and copy configuration files to it.
install -d $(bdir)
cp debian/drivers.list.debian $(bdir)/drivers.list
cp sys_linux/g77_gcc.conf sys_linux/g77_gcc.conf.orig
cp debian/g77_gcc.conf.debian sys_linux/g77_gcc.conf
cd $(bdir); $(curdir)/makemake $(curdir) linux g77_gcc
# changeperl no longer necessary - upstream uses /usr/bin/perl now
# perl debian/changeperl
cd $(bdir);make FFLAGC="-u -Wall -O2" CFLAGC="-Wall -DPG_PPU -O3" all;make clean;make FFLAGC="-u -Wall -O2" CFLAGC="-Wall -DPG_PPU -O3" cpg;make pgplot.html;make pgplot-routines.tex
# -cd $(bdir); rm *.o
cd $(bdir) ; make clean; make FFLAGC="-u -Wall -O2 -fPIC" CFLAGC="-Wall -fPIC -D_REENTRANT -DPG_PPU -O3" VM="$(version_major)" shared cpg-shared
touch build-stamp
clean:
dh_testdir
dh_testroot
-rm -rf static shared
-rm -f build-stamp install-stamp
-rm -rf $(bdir)
# -make clean
# -rm -f `find . -name "*~"`
# -rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
-rm -f debian/*substvars
dh_clean
install: install-stamp
install-stamp: build-stamp $(64-BIT_CLEAN_STAMP)
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(INSTALL_DATA) $(bdir)/libpgplot.a $(packagedir)/usr/lib/
$(INSTALL_DATA) $(bdir)/libcpgplot.a $(packagedir)/usr/lib/
$(INSTALL_DATA) $(bdir)/libpgplot.so $(packagedir)/usr/lib/libpgplot.so.$(version)
$(INSTALL_DATA) $(bdir)/libcpgplot.so $(packagedir)/usr/lib/libcpgplot.so.$(version)
strip --strip-unneeded $(packagedir)/usr/lib/libpgplot.so.$(version)
strip --strip-unneeded $(packagedir)/usr/lib/libcpgplot.so.$(version)
ln -s lib$(package).so.$(version) $(packagedir)/usr/lib/lib$(package).so.$(version_major)
ln -s libcpgplot.so.$(version) $(packagedir)/usr/lib/libcpgplot.so.$(version_major)
ln -s lib$(package).so.$(version_major) $(packagedir)/usr/lib/lib$(package).so
ln -s libcpgplot.so.$(version_major) $(packagedir)/usr/lib/libcpgplot.so
# chmod 644 $(packagedir)/usr/lib/$(npackage)/*
$(INSTALL_DATA) $(bdir)/cpgplot.h $(packagedir)/usr/include/
# $(INSTALL_STRIP) $(bdir)/pgdisp $(packagedir)/usr/bin/
# install $(bdir)/pgbind $(packagedir)/usr/bin/
$(INSTALL_STRIP) $(bdir)/pgxwin_server $(packagedir)/usr/bin/
# cd $(packagedir)/usr/bin ; strip --strip-unneeded pgdisp pgxwin_server
$(INSTALL_DATA) $(bdir)/grexec.f $(packagedir)/usr/lib/$(npackage)
$(INSTALL_DATA) $(bdir)/grfont.dat $(packagedir)/usr/lib/$(npackage)
$(INSTALL_DATA) $(bdir)/grexec.f $(packagedir)/usr/lib/$(npackage)
$(INSTALL_DATA) $(bdir)/rgb.txt $(packagedir)/usr/lib/$(npackage)
$(INSTALL_DATA) $(bdir)/grpckg1.inc $(packagedir)/usr/lib/$(npackage)
# Install the overrides file for lintian
cp -a debian/overrides $(packagedir)/usr/share/lintian/overrides/pgplot5
#dh_movefiles
touch install-stamp
binary-indep: build install
# $(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: build install
# dh_testversion
dh_testdir -a
dh_testroot -a
# -rm -rf $(packagedir)
# install -d $(packagedir)/DEBIAN
# Insert appropriate lines into shlibs file
#
# echo -e '$(shl1)\n' >$(packagedir)/DEBIAN/shlibs
# install -d $(packagedir)/usr/doc/$(npackage)/examples
# install -d $(packagedir)/usr/lib/$(npackage)
# install -d $(packagedir)/usr/bin
# cd $(packagedir) && install -d `cat ../dirs`
$(INSTALL_DATA) $(bdir)/pgplot.doc $(packagedir)/usr/share/doc/$(npackage)
$(GZIP_DATA) $(packagedir)/usr/share/doc/$(npackage)/pgplot.doc
# cp pgdispd/aaaread.me $(packagedir)/usr/share/doc/$(npackage)/pgdisp.txt
# $(GZIP_DATA) $(packagedir)/usr/share/doc/$(npackage)/pgdisp.txt
$(INSTALL_DATA) $(bdir)/drivers.list $(packagedir)/usr/share/doc/$(npackage)
$(GZIP_DATA) $(packagedir)/usr/share/doc/$(npackage)/drivers.list
$(INSTALL_DATA) $(bdir)/pgplot-routines.tex $(packagedir)/usr/share/doc/$(npackage)
$(GZIP_DATA) $(packagedir)/usr/share/doc/$(npackage)/pgplot-routines.tex
$(INSTALL_DATA) $(bdir)/pgplot.html $(packagedir)/usr/share/doc/$(npackage)
$(INSTALL_DATA) cpg/cpgplot.doc $(packagedir)/usr/share/doc/$(npackage)
$(GZIP_DATA) $(packagedir)/usr/share/doc/$(npackage)/cpgplot.doc
# $(INSTALL_DATA) cpg/cpgdemo.c $(packagedir)/usr/share/doc/$(npackage)/examples
# $(INSTALL_DATA) debian/pgplot.3x $(packagedir)/usr/man/man3
# gzip -9v $(packagedir)/usr/man/man3/*
dh_installman
dh_installdocs
$(INSTALL_DATA) aaaread.me $(packagedir)/usr/share/doc/$(npackage)
# $(INSTALL_DATA) install-unix.txt $(packagedir)/usr/share/doc/$(npackage)
$(INSTALL_DATA) ver5*.txt $(packagedir)/usr/share/doc/$(npackage)
dh_installexamples examples/*.f
dh_installexamples cpg/cpgdemo.c
# cp examples/* $(packagedir)/usr/share/doc/$(npackage)/examples
# Install installation scripts
#
# cp debian/postinst $(packagedir)/DEBIAN/.
# chmod +x $(packagedir)/DEBIAN/postinst
dh_installchangelogs
$(INSTALL_DATA) debian/copyright $(packagedir)/usr/share/doc/$(npackage)
$(INSTALL_DATA) debian/changelog $(packagedir)/usr/share/doc/$(npackage)/changelog.Debian
$(GZIP_DATA) $(packagedir)/usr/share/doc/$(npackage)/changelog.Debian
dh_strip -a $(packagedir)/usr/bin/*
dh_makeshlibs -a
dh_link -a
# dh_dhelp
dh_compress -a
dh_fixperms -a
# dh_suidregister -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
# cp debian/README.debian $(packagedir)/usr/doc/$(npackage)
# cp debian/changelog $(packagedir)/usr/doc/$(npackage)/changelog.Debian
# gzip -9v $(packagedir)/usr/doc/$(npackage)/changelog.Debian
# cp debian/copyright $(packagedir)/usr/doc/$(npackage)
# dpkg-shlibdeps $(packagedir)/usr/lib/libpgplot.so.$(version)
# dpkg-gencontrol
# chown -R root.root $(packagedir)
# chmod -R go=rX $(packagedir)
# dpkg --build $(packagedir) ..
#define checkdir
# test -f debian/rules
#endef
binary: binary-indep binary-arch
#checkroot:
# $(checkdir)
# test root = "`whoami`"
.PHONY: build clean binary-indep binary-arch binary install
|