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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# "based" on template debian/rules for most debian packages version 0.27
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#For overriding debian/compat
#export DH_COMPAT=7
#This rule file have a bashism
SHELL:=/bin/bash
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
# Personall Variables
PACKNAME=$(shell dh_listpackages)
PACKAGE=$(shell dh_listpackages)
# Variabels used by the Debian Maintainer exclusively for package
# development.
SOURCENAME=$(shell dpkg-parsechangelog | grep "Source:" | cut -d ' ' -f 2)
DEBVER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2)
VER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2 | cut -f 1 -d -)
ifeq ($(DEBVER),$(VER))
NATIVE=1
else
NATIVE=0
endif
MDIST=wheezy
DIST=$(shell dpkg-parsechangelog | grep "Distribution" | cut -d ' ' -f 2)
SECTION=main
ifeq ($(NATIVE),0)
DISTFILE=$(SOURCENAME)_$(VER).orig.tar.xz
#DISTFILES=$(DISTFILE) $(SOURCENAME)_$(DEBVER).diff.gz
DISTFILES=$(DISTFILE) $(SOURCENAME)_$(DEBVER).debian.tar.xz
else
DISTFILE=$(SOURCENAME)_$(DEBVER).tar.xz
DISTFILES=$(DISTFILE)
endif
SCONS=scons
SCONSFLAGS=prefix=/usr \
bindir=/usr/bin sbindir=/usr/sbin \
mandir=/usr/share/man infodir=/usr/share/info \
sysconfdir=/etc \
with-olsr=true \
disable_fw=true \
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS='-Wl,-z,defs'
#SCONSFLAGS += CC=gcc-4.6 CXX=g++-4.6
CFLAGS = -Wall -g
GXXVERSION = $(shell g++ --version | head -1 | cut -f 4 -d ' ' | cut -b 1-3)
#ifeq ($(GXXVERSION),4.6)
# CXXFLAGS += -Wno-error=unused-but-set-variable
#endif
ifeq ($(GXXVERSION),4.7)
CXXFLAGS += -Wno-error=cast-qual
CFLAGS += -Wno-error=maybe-uninitialized
endif
ifeq ($(GXXVERSION),4.8)
CXXFLAGS += -Wno-error=cast-qual -Wno-error=sizeof-pointer-memaccess
CFLAGS += -Wno-error=maybe-uninitialized
endif
ifeq ($(GXXVERSION),4.9)
CXXFLAGS += -Wno-error=cast-qual -Wno-error=sizeof-pointer-memaccess
CFLAGS += -Wno-error=maybe-uninitialized
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
include /usr/share/quilt/quilt.make
config.status: debian/stamp-patched
dh_testdir
# Add here commands to configure the package.
build: build-arch build-indep
build-indep: build-indep-stamp
build-indep-stamp:
# Upstream dropped documentation out of source code
touch $@
build-arch: build-arch-stamp
build-arch-stamp: config.status
dh_testdir
# Compile the package
$(SCONS) $(SCONSFLAGS)
docbook-to-man debian/xorp_rtrmgr.sgml > debian/xorp_rtrmgr.8
docbook-to-man debian/xorpsh.sgml > debian/xorpsh.1
touch $@
check:
$(SCONS) $(SCONSFLAGS) check
clean:
dh_testdir
dh_testroot
# Add here commands to clean up after the build process.
$(SCONS) $(SCONSFLAGS) -c
rm -rf obj
debian/rules unpatch || rm debian/stamp-patched
rm -f config.status config.log build-arch-stamp build-indep-stamp
rm -f relpath.pyc site_scons/*/*.pyc
rm -f xrl/scripts/Xif/*.pyc
dh_clean
install: install-arch
install-arch:
dh_testdir
dh_testroot
#dh_clean -k -a
dh_prep
dh_installdirs -a
# Install the program:
$(SCONS) $(SCONSFLAGS) \
DESTDIR=$(CURDIR)/debian/$(SOURCENAME) install
# After the install, we move the files and create the symlinks :
for file in rib_xrl_shell_funcs.sh fea_xrl_shell_funcs.sh bgp_xrl_shell_funcs.sh ; do mv debian/$(SOURCENAME)/usr/sbin/$$file debian/$(SOURCENAME)/usr/lib/xorp/bin/ ; done
cd debian/$(SOURCENAME)/usr/sbin/ && find -type f -exec ln -vsf /usr/sbin/{} ../lib/xorp/bin/ \; && cd $(CURDIR)
# Config files:
cp debian/config.boot.small debian/$(SOURCENAME)/etc/xorp/config.boot
cp debian/$(SOURCENAME).default debian/$(SOURCENAME)/etc/default/xorp
cp debian/$(SOURCENAME).init.d debian/$(SOURCENAME)/etc/init.d/xorp
dh_install -s
# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples -pxorp rtrmgr/config/*.boot debian/config.boot.mcast rtrmgr/config/README
dh_installlogrotate
dh_installinit
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Experimental rule to build archive for public distribution
# Non-native package
dist-exp: clean
ifeq ($(NATIVE),0)
# Non native package
if test -e ../$(DISTFILE) ; then echo "$(DISTFILE) file should be generated only once" ; false ; fi
#cp -al ../$(SOURCENAME) ../$(SOURCENAME)-$(VER)
cd .. && tar --exclude='.svn' --exclude='debian' --exclude='tmp' --exclude='*~' -cf - $(SOURCENAME) | xz -v9 -c > $(DISTFILE)
cd .. && svn add $(DISTFILE)
else
# native package
cd .. && tar --exclude='.svn' --exclude='tmp' --exclude='*~' -czf - $(SOURCENAME) | xz -v9 -c > $(DISTFILE)
cd .. && svn add $(DISTFILE)
endif
# Build architecture dependant packages using the common target.
binary-arch: build-arch-stamp install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
binary: binary-arch
# Check variabels used by the Debian Maintainer exclusively for
# package development.
vars:
echo $(VER) $(DEBVER) $(MDIST) $(DIST) $(PACKNAME) $(SOURCENAME)
echo $(REPOSTARGET)
echo $(REPOSARCH)
echo $(DEB_HOST_GNU_TYPE) $(DEB_BUILD_GNU_TYPE)
upload:
scp ../*_$(DEBVER).* ../*_$(DEBVER)_* debian:/var/www/debian/debian/dists/$(MDIST)/$(DIST)/$(SECTION)/
mkdir -p ~/debian/$(SECTION)/other_sources/$(SOURCENAME)
cp ../*_$(DEBVER).* ../*_$(DEBVER)_* ~/debian/$(SECTION)/other_sources/$(SOURCENAME)
# Make tags of the sources as documented by subversion
tag:
cd .. ; svn add $(DISTFILES) ;\
echo $(CURDIR)
cd .. ; svn add $(SOURCENAME)_$(DEBVER)_*.changes \
$(SOURCENAME)_$(DEBVER)_*.build \
$(SOURCENAME)_$(DEBVER).dsc
cd .. ; svn add *_$(DEBVER)_*.deb
cd .. ; svn st ; echo "enter to continue" ; read enter
cd .. ; shopt -s nullglob ; svn ci -m "released v$(DEBVER)" \
$(DISTFILES) \
$(SOURCENAME)_$(DEBVER)_*.changes \
$(SOURCENAME)_$(DEBVER)_*.build \
$(SOURCENAME)_$(DEBVER).dsc \
*_$(DEBVER)_*.deb
svn mkdir --parents -m "Preparing tag directory for release v$(DEBVER)" $(shell svn info | grep "Repository Root" | cut -d ' ' -f 3)/tags/src/$(SOURCENAME)/$(SOURCENAME)-$(DEBVER)
cd .. ; shopt -s nullglob ; svn copy -m "released v$(DEBVER)" \
$(DISTFILES) \
$(SOURCENAME)_$(DEBVER)_*.changes \
$(SOURCENAME)_$(DEBVER)_*.build \
$(SOURCENAME)_$(DEBVER).dsc \
*_$(DEBVER)_*.deb \
$(shell svn info | grep "Repository Root" | cut -d ' ' -f 3)/tags/src/$(SOURCENAME)/$(SOURCENAME)-$(DEBVER)
debchange -i "New release"
.PHONY: build clean binary-indep binary-arch binary install
|