rules 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 -m 755 contrib/torify $(CURDIR)/debian/tor/usr/bin
  58. install -m 644 contrib/torify.1 $(CURDIR)/debian/tor/usr/share/man/man1
  59. install -m 644 contrib/tor-tsocks.conf $(CURDIR)/debian/tor/etc/tor
  60. install -m 644 debian/tor.lintian-override $(CURDIR)/debian/tor/usr/share/lintian/overrides/tor
  61. # Build architecture-independent files here.
  62. binary-indep: build install
  63. # We have nothing to do by default.
  64. # Build architecture-dependent files here.
  65. binary-arch: build install
  66. dh_testdir
  67. dh_testroot
  68. dh_installchangelogs ChangeLog
  69. dh_installdocs
  70. dh_installexamples
  71. # dh_install
  72. # dh_installdebconf
  73. dh_installlogrotate
  74. # dh_installemacsen
  75. # dh_installmime
  76. dh_installinit
  77. # dh_installcron
  78. dh_installman
  79. dh_link
  80. #dh_strip
  81. dh_compress
  82. dh_fixperms
  83. dh_installdeb
  84. dh_shlibdeps
  85. dh_gencontrol
  86. dh_md5sums
  87. dh_builddeb
  88. binary: binary-indep binary-arch
  89. .PHONY: build clean binary-indep binary-arch binary install