rules 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/usr/bin/make -f
  2. # -*- makefile -*-
  3. # Sample debian/rules that uses debhelper.
  4. # GNU copyright 1997 to 1999 by Joey Hess.
  5. # Uncomment this to turn on verbose mode.
  6. #export DH_VERBOSE=1
  7. # These are used for cross-compiling and for saving the configure script
  8. # from having to guess our platform (since we know it already)
  9. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  10. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  11. CFLAGS = -Wall -g
  12. export PACKAGE=tor
  13. include /usr/share/dpatch/dpatch.make
  14. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  15. CFLAGS += -O0
  16. else
  17. CFLAGS += -O2
  18. endif
  19. #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  20. # INSTALL_PROGRAM += -s
  21. #endif
  22. configure: patch-stamp
  23. config.status: configure
  24. dh_testdir
  25. CFLAGS="$(CFLAGS)" ./configure \
  26. --host=$(DEB_HOST_GNU_TYPE) \
  27. --build=$(DEB_BUILD_GNU_TYPE) \
  28. --prefix=/usr \
  29. --mandir=\$${prefix}/share/man \
  30. --infodir=\$${prefix}/share/info \
  31. --localstatedir=/var \
  32. --sysconfdir=/etc
  33. build: build-stamp
  34. build-stamp: config.status
  35. dh_testdir
  36. $(MAKE)
  37. @echo
  38. @echo
  39. src/or/test
  40. @echo
  41. touch build-stamp
  42. clean: unpatch
  43. dh_testdir
  44. dh_testroot
  45. rm -f build-stamp
  46. -$(MAKE) distclean
  47. dh_clean
  48. install: build
  49. dh_testdir
  50. dh_testroot
  51. dh_clean -k
  52. dh_installdirs
  53. $(MAKE) install DESTDIR=$(CURDIR)/debian/tor
  54. # move tor to where it belongs
  55. mv $(CURDIR)/debian/tor/etc/tor/torrc.sample $(CURDIR)/debian/tor/etc/tor/torrc
  56. mv $(CURDIR)/debian/tor/usr/bin/tor $(CURDIR)/debian/tor/usr/sbin/tor
  57. install -d $(CURDIR)/debian/tor/usr/share/man/man8
  58. mv $(CURDIR)/debian/tor/usr/share/man/man1/tor.1 $(CURDIR)/debian/tor/usr/share/man/man8/tor.8
  59. install -m 755 contrib/torify $(CURDIR)/debian/tor/usr/bin
  60. install -m 644 contrib/torify.1 $(CURDIR)/debian/tor/usr/share/man/man1
  61. install -m 644 contrib/tor-tsocks.conf $(CURDIR)/debian/tor/etc/tor
  62. install -m 644 debian/tor.lintian-override $(CURDIR)/debian/tor/usr/share/lintian/overrides/tor
  63. # Build architecture-independent files here.
  64. binary-indep: build install
  65. # We have nothing to do by default.
  66. # Build architecture-dependent files here.
  67. binary-arch: build install
  68. dh_testdir
  69. dh_testroot
  70. dh_installchangelogs ChangeLog
  71. dh_installdocs
  72. dh_installexamples
  73. # dh_install
  74. # dh_installdebconf
  75. dh_installlogrotate
  76. # dh_installemacsen
  77. # dh_installmime
  78. dh_installinit
  79. # dh_installcron
  80. dh_installman
  81. dh_link
  82. #dh_strip
  83. dh_compress
  84. dh_fixperms
  85. dh_installdeb
  86. dh_shlibdeps
  87. dh_gencontrol
  88. dh_md5sums
  89. dh_builddeb
  90. binary: binary-indep binary-arch
  91. .PHONY: build clean binary-indep binary-arch binary install