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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
|
#!/usr/bin/make -f
# rules file for openjade
#
# The principle of these rules files are simplicity, robustness,
# ease of maintenance, and readability through abstraction
#
# Some bytes in this file may have been touched by Ian Jackson,
# so I can never remove his name from this file. Oh boy.
#
# This file was modified from the jade rules file.
export DH_COMPAT=3
pkg := openjade
pkg-openjade := $(pkg)
pkg-libostyle := libostyle0
pkg-libostyle-dev := libostyle-dev
# directory abstraction
prefix-openjade := debian/$(pkg-openjade)
bindir-openjade := $(prefix-openjade)/usr/bin
confdir-openjade := $(prefix-openjade)/etc
libdir-openjade := $(prefix-openjade)/usr/share/sgml/OpenJade
sgmldir-openjade := $(prefix-openjade)/usr/lib/sgml
docdir-openjade := $(prefix-openjade)/usr/share/doc/$(pkg-openjade)
infodir-openjade := $(prefix-openjade)/usr/share/info
sharedir-openjade := $(prefix-openjade)/usr/share
mandir-openjade := $(prefix-openjade)/usr/share/man/man1
prefix-libostyle := debian/$(pkg-libostyle)
docdir-libostyle := $(prefix-libostyle)/usr/share/doc/$(pkg-libostyle)
libdir-libostyle := $(prefix-libostyle)/usr/lib
prefix-libostyle-dev := debian/$(pkg-libostyle-dev)
incdir-libostyle-dev := $(prefix-libostyle-dev)/usr/include/OpenJade
docdir-libostyle-dev := $(prefix-libostyle-dev)/usr/share/doc/$(pkg-libostyle-dev)
libdir-libostyle-dev := $(prefix-libostyle-dev)/usr/lib
# build tool abstraction
install_file := install -o root -g root -m 644 -p
install_script := install -o root -g root -m 755 -p
install_program := install -o root -g root -m 755 -p
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
install_program += --strip
endif
make_directory := install -d -o root -g root -m 755
compress := gzip -9f
CFLAGS := -O3 --pipe
CXXFLAGS := -O3 --pipe
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
CXXFLAGS += -g
endif
ifneq (,$(findstring hppa,$(DEB_BUILD_ARCH)))
CFLAGS += -ffunction-sections
CXXFLAGS += -ffunction-sections
endif
export CFLAGS
export CXXFLAGS
# flags to get automake to use the above
am_inst_flags := INSTALL='install -o root -g root -p' \
INSTALL_PROGRAM='$(install_program)' \
INSTALL_SCRIPT='$(install_script)' \
INSTALL_DATA='$(install_file)'
# first version of package providing the right shlibs
SHLIBS_PKGVER := 1.4devel1-1
# extra docs we don't want
DOCS_TOO_MUCH := ABOUT-NLS COPYING copying.txt ChangeLog
# determine our version numbers
SRC_VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//')
UPSTREAM_VERSION:= $(shell echo $(SRC_VERSION) | sed -e 's/^\(.*\)-[^-]*$$/\1/')
# determine our top level
SRCDIR := $(shell pwd)
# stuff for snapshot/cvs building
root_cmd := sudo
deb_build := dpkg-buildpackage -ppgp -r$(root_cmd) -b
cvs_build_dir := $(HOME)/debian/$(pkg-openjade)
cvs_ver_build_dir := $(cvs_build_dir)/$(pkg-openjade)-$(UPSTREAM_VERSION)
cvs_pure_src_dir := ..
cvs_pure_src := $(pkg-openjade)
ChangeLog:
[ ! -e OpenJade-$(UPSTREAM_VERSION) ]
[ -f $(cvs_pure_src_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz ]
tar -xzvf $(cvs_pure_src_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz \
OpenJade-1.4devel/ChangeLog
mv OpenJade-1.4devel/ChangeLog .
rm -r OpenJade-1.4devel
config.status: ChangeLog
aclocal
autoheader
libtoolize --force
automake --add-missing
autoreconf
./configure --prefix=/usr --sysconfdir=/etc \
--datadir='$${prefix}/share/sgml' \
--mandir='$${prefix}/share/man' \
--enable-http --enable-shared \
--enable-static
build: config.status
$(checkdir)
$(MAKE) SUBDIRS="grove spgrove style" CXXFLAGS="$(CXXFLAGS) -D_REENTRANT"
$(MAKE)
touch build
clean:
$(checkdir)
[ ! -f Makefile ] || $(MAKE) maintainer-clean || true
find . -type l | xargs rm -f
dh_clean build binary-arch debian/substvars debian/copyright \
debian/$(pkg-libostyle).shlibs
binary-indep: build
# There are no architecture-independent files to be uploaded
# generated by this package.
debian/copyright: COPYING debian/copyright.Debian
# to ensure we have a verbatim copy of the upstream copyright,
# cat the Debian-specific stuff to the end of the upstream file
cat $^ > $@
debian/substvars:
# indicate our providing version of shlibs; this must be
# sync'd with debian/control
: > debian/substvars
echo "openjade:Version=$(pkg-openjade) (= $(SRC_VERSION))" \
>> debian/substvars
echo "libostyle:Version=$(pkg-libostyle) (= $(SRC_VERSION))" \
>> debian/substvars
echo "libostyle:ShlibVersion=$(pkg-libostyle) (>= $(SHLIBS_PKGVER))" \
>> debian/substvars
debian/$(pkg-libostyle).shlibs:
# std shlibs file, with the first version that supplied the version
# that applications should build with
: > $@
echo "libostyle 0 $(pkg-libostyle) (>= $(SHLIBS_PKGVER))" >> $@
echo "libogrove 0 $(pkg-libostyle) (>= $(SHLIBS_PKGVER))" >> $@
echo "libospgrove 0 $(pkg-libostyle) (>= $(SHLIBS_PKGVER))" >> $@
binary-arch: build debian/copyright debian/substvars \
debian/$(pkg-libostyle).shlibs debian/README.Debian
$(checkdir)
$(checkroot)
##
## openjade
##
rm -rf $(prefix-openjade)
$(make_directory) $(bindir-openjade) $(sgmldir-openjade) \
$(mandir-openjade)
# we can't use SUBDIRS here since that trickles down;
# install it all into openjade dir
$(MAKE) install \
prefix=$(SRCDIR)/$(prefix-openjade)/usr \
pkgdocdir=$(SRCDIR)/$(docdir-openjade) \
$(am_inst_flags)
# remove the extra docs installed from top-level Makefile
cd $(docdir-openjade) && rm -f $(DOCS_TOO_MUCH)
# install unicode stuff -- this should probably be handled in
# upstream Makefiles
$(make_directory) $(libdir-openjade)/unicode
$(install_file) unicode/catalog unicode/demo.sgm unicode/unicode.syn \
$(libdir-openjade)/unicode
$(install_file) unicode/unicode.sd $(libdir-openjade)/unicode/
$(install_script) unicode/gensyntax.pl $(libdir-openjade)/unicode
# install man pages
dh_undocumented -p$(pkg-openjade) openjade.1
# prepare for alternatives system
mv $(prefix-openjade)/usr/bin/openjade $(prefix-openjade)/usr/bin/openjade-1.4devel
mv $(prefix-openjade)/usr/share/man/man1/openjade.1.gz $(prefix-openjade)/usr/share/man/man1/openjade-1.4devel.1.gz
#
# make sure maintainer scripts are good
sh -n debian/$(pkg-openjade).postinst
sh -n debian/$(pkg-openjade).prerm
##
## libostyle
##
rm -rf $(prefix-libostyle)
$(make_directory) $(libdir-libostyle)
mv $(prefix-openjade)/usr/lib/lib*.so.*.* $(libdir-libostyle)/
mv $(prefix-openjade)/usr/lib/lib*.so.* $(libdir-libostyle)/
# make sure maintainer scripts are good
sh -n debian/$(pkg-libostyle).postinst
##
## libostyle-dev
##
rm -rf $(prefix-libostyle-dev)
$(make_directory) $(incdir-libostyle-dev) $(libdir-libostyle-dev)\
$(docdir-libostyle-dev)
mv $(prefix-openjade)/usr/lib/lib*.* $(libdir-libostyle-dev)/
##
## common to all
##
# install Debian-std docs
dh_installdocs -a
# optionally, install upstream ChangeLog
[ ! -f ChangeLog ] || dh_installchangelogs -a ChangeLog
[ -f ChangeLog ] || dh_installchangelogs -a
dh_installdeb -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_shlibdeps -l $(pkg-libostyle) -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
touch binary-arch
# cvs snapshot building
cvs-build: clean
[ -d $(cvs_pure_src_dir)/$(cvs_pure_src)/CVS ] || exit 1
$(root_cmd) rm -rf $(cvs_ver_build_dir)
# rm -f $(cvs_build_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz
# don't do cvs up or make the changelog
install -d -m 755 $(cvs_ver_build_dir)
# GZIP=-9 tar czf $(cvs_build_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz \
# -C $(cvs_pure_src_dir) --exclude CVS $(cvs_pure_src)
tar cf - --exclude CVS . | tar xf - -C $(cvs_ver_build_dir)
[ -f ChangeLog ] || cvs2cl -r -t -b
cp ChangeLog $(cvs_ver_build_dir)/
cd $(cvs_ver_build_dir) && $(deb_build)
define checkdir
test -f debian/rules && test -d jade
endef
# Below here is fairly generic really
define checkroot
test `id -u` = 0
endef
binary: binary-indep binary-arch
.PHONY: binary binary-indep clean
#Local variables:
#mode: makefile
#End:
|