PageRenderTime 57ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/make/fossil-scm.mk

https://bitbucket.org/rainlake/optware
Makefile | 226 lines | 86 code | 18 blank | 122 comment | 4 complexity | f84881aa904c997aa0982aabdfbb05e1 MD5 | raw file
  1. ###########################################################
  2. #
  3. # fossil-scm
  4. #
  5. ###########################################################
  6. #
  7. # FOSSIL-SCM_HASH, FOSSIL-SCM_SITE and FOSSIL-SCM_SOURCE define
  8. # the upstream location of the source code for the package.
  9. # FOSSIL-SCM_DIR is the directory which is created when the source
  10. # archive is unpacked.
  11. # FOSSIL-SCM_UNZIP is the command used to unzip the source.
  12. # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
  13. #
  14. # You should change all these variables to suit your package.
  15. # Please make sure that you add a description, and that you
  16. # list all your packages' dependencies, seperated by commas.
  17. #
  18. # If you list yourself as MAINTAINER, please give a valid email
  19. # address, and indicate your irc nick if it cannot be easily deduced
  20. # from your name or email address. If you leave MAINTAINER set to
  21. # "NSLU2 Linux" other developers will feel free to edit.
  22. #
  23. FOSSIL-SCM_SITE=http://www.fossil-scm.org
  24. FOSSIL-SCM_VERSION=20090916
  25. FOSSIL-SCM_HASH=0eb08b860c
  26. FOSSIL-SCM_DIR=Fossil-$(FOSSIL-SCM_HASH)
  27. FOSSIL-SCM_SOURCE=$(FOSSIL-SCM_DIR).zip
  28. FOSSIL-SCM_UNZIP=unzip
  29. FOSSIL-SCM_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
  30. FOSSIL-SCM_DESCRIPTION=Simple, high-reliability, distributed software configuration management
  31. FOSSIL-SCM_SECTION=utils
  32. FOSSIL-SCM_PRIORITY=optional
  33. FOSSIL-SCM_DEPENDS=zlib
  34. FOSSIL-SCM_SUGGESTS=
  35. FOSSIL-SCM_CONFLICTS=
  36. #
  37. # FOSSIL-SCM_IPK_VERSION should be incremented when the ipk changes.
  38. #
  39. FOSSIL-SCM_IPK_VERSION=1
  40. #
  41. # FOSSIL-SCM_CONFFILES should be a list of user-editable files
  42. #FOSSIL-SCM_CONFFILES=/opt/etc/fossil-scm.conf /opt/etc/init.d/SXXfossil-scm
  43. #
  44. # FOSSIL-SCM_PATCHES should list any patches, in the the order in
  45. # which they should be applied to the source code.
  46. #
  47. #FOSSIL-SCM_PATCHES=$(FOSSIL-SCM_SOURCE_DIR)/configure.patch
  48. #
  49. # If the compilation of the package requires additional
  50. # compilation or linking flags, then list them here.
  51. #
  52. FOSSIL-SCM_CPPFLAGS=
  53. FOSSIL-SCM_LDFLAGS=
  54. #
  55. # FOSSIL-SCM_BUILD_DIR is the directory in which the build is done.
  56. # FOSSIL-SCM_SOURCE_DIR is the directory which holds all the
  57. # patches and ipkg control files.
  58. # FOSSIL-SCM_IPK_DIR is the directory in which the ipk is built.
  59. # FOSSIL-SCM_IPK is the name of the resulting ipk files.
  60. #
  61. # You should not change any of these variables.
  62. #
  63. FOSSIL-SCM_BUILD_DIR=$(BUILD_DIR)/fossil-scm
  64. FOSSIL-SCM_SOURCE_DIR=$(SOURCE_DIR)/fossil-scm
  65. FOSSIL-SCM_IPK_DIR=$(BUILD_DIR)/fossil-scm-$(FOSSIL-SCM_VERSION)-ipk
  66. FOSSIL-SCM_IPK=$(BUILD_DIR)/fossil-scm_$(FOSSIL-SCM_VERSION)-$(FOSSIL-SCM_IPK_VERSION)_$(TARGET_ARCH).ipk
  67. .PHONY: fossil-scm-source fossil-scm-unpack fossil-scm fossil-scm-stage fossil-scm-ipk fossil-scm-clean fossil-scm-dirclean fossil-scm-check
  68. #
  69. # This is the dependency on the source code. If the source is missing,
  70. # then it will be fetched from the site using wget.
  71. #
  72. $(DL_DIR)/$(FOSSIL-SCM_SOURCE):
  73. $(WGET) -P $(@D) $(SOURCES_NLO_SITE)/$(@F)
  74. # $(WGET) -P $(@D) $(FOSSIL-SCM_SITE)/$(@F)
  75. #
  76. # The source code depends on it existing within the download directory.
  77. # This target will be called by the top level Makefile to download the
  78. # source code's archive (.tar.gz, .bz2, etc.)
  79. #
  80. fossil-scm-source: $(DL_DIR)/$(FOSSIL-SCM_SOURCE) $(FOSSIL-SCM_PATCHES)
  81. #
  82. # This target unpacks the source code in the build directory.
  83. # If the source archive is not .tar.gz or .tar.bz2, then you will need
  84. # to change the commands here. Patches to the source code are also
  85. # applied in this target as required.
  86. #
  87. # This target also configures the build within the build directory.
  88. # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
  89. # and NOT $(MAKE) below. Passing it to configure causes configure to
  90. # correctly BUILD the Makefile with the right paths, where passing it
  91. # to Make causes it to override the default search paths of the compiler.
  92. #
  93. # If the compilation of the package requires other packages to be staged
  94. # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
  95. #
  96. # If the package uses GNU libtool, you should invoke $(PATCH_LIBTOOL) as
  97. # shown below to make various patches to it.
  98. #
  99. $(FOSSIL-SCM_BUILD_DIR)/.configured: $(DL_DIR)/$(FOSSIL-SCM_SOURCE) $(FOSSIL-SCM_PATCHES) make/fossil-scm.mk
  100. $(MAKE) zlib-stage
  101. rm -rf $(BUILD_DIR)/$(FOSSIL-SCM_DIR) $(@D)
  102. cd $(BUILD_DIR) && $(FOSSIL-SCM_UNZIP) $(DL_DIR)/$(FOSSIL-SCM_SOURCE)
  103. if test -n "$(FOSSIL-SCM_PATCHES)" ; \
  104. then cat $(FOSSIL-SCM_PATCHES) | \
  105. patch -d $(BUILD_DIR)/$(FOSSIL-SCM_DIR) -p0 ; \
  106. fi
  107. if test "$(BUILD_DIR)/$(FOSSIL-SCM_DIR)" != "$(@D)" ; \
  108. then mv $(BUILD_DIR)/$(FOSSIL-SCM_DIR) $(@D) ; \
  109. fi
  110. # (cd $(@D); \
  111. $(TARGET_CONFIGURE_OPTS) \
  112. CPPFLAGS="$(STAGING_CPPFLAGS) $(FOSSIL-SCM_CPPFLAGS)" \
  113. LDFLAGS="$(STAGING_LDFLAGS) $(FOSSIL-SCM_LDFLAGS)" \
  114. ./configure \
  115. --build=$(GNU_HOST_NAME) \
  116. --host=$(GNU_TARGET_NAME) \
  117. --target=$(GNU_TARGET_NAME) \
  118. --prefix=/opt \
  119. --disable-nls \
  120. --disable-static \
  121. )
  122. # $(PATCH_LIBTOOL) $(@D)/libtool
  123. touch $@
  124. fossil-scm-unpack: $(FOSSIL-SCM_BUILD_DIR)/.configured
  125. #
  126. # This builds the actual binary.
  127. #
  128. $(FOSSIL-SCM_BUILD_DIR)/.built: $(FOSSIL-SCM_BUILD_DIR)/.configured
  129. rm -f $@
  130. $(MAKE) -C $(@D) \
  131. TCC="$(TARGET_CC) -Wall $(STAGING_CPPFLAGS)" \
  132. LDFLAGS="$(STAGING_LDFLAGS) $(FOSSIL-SCM_LDFLAGS)" \
  133. ;
  134. touch $@
  135. #
  136. # This is the build convenience target.
  137. #
  138. fossil-scm: $(FOSSIL-SCM_BUILD_DIR)/.built
  139. #
  140. # If you are building a library, then you need to stage it too.
  141. #
  142. #$(FOSSIL-SCM_BUILD_DIR)/.staged: $(FOSSIL-SCM_BUILD_DIR)/.built
  143. # rm -f $@
  144. # $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
  145. # touch $@
  146. #
  147. #fossil-scm-stage: $(FOSSIL-SCM_BUILD_DIR)/.staged
  148. #
  149. # This rule creates a control file for ipkg. It is no longer
  150. # necessary to create a seperate control file under sources/fossil-scm
  151. #
  152. $(FOSSIL-SCM_IPK_DIR)/CONTROL/control:
  153. @install -d $(@D)
  154. @rm -f $@
  155. @echo "Package: fossil-scm" >>$@
  156. @echo "Architecture: $(TARGET_ARCH)" >>$@
  157. @echo "Priority: $(FOSSIL-SCM_PRIORITY)" >>$@
  158. @echo "Section: $(FOSSIL-SCM_SECTION)" >>$@
  159. @echo "Version: $(FOSSIL-SCM_VERSION)-$(FOSSIL-SCM_IPK_VERSION)" >>$@
  160. @echo "Maintainer: $(FOSSIL-SCM_MAINTAINER)" >>$@
  161. @echo "Source: $(FOSSIL-SCM_SITE)/$(FOSSIL-SCM_SOURCE)" >>$@
  162. @echo "Description: $(FOSSIL-SCM_DESCRIPTION)" >>$@
  163. @echo "Depends: $(FOSSIL-SCM_DEPENDS)" >>$@
  164. @echo "Suggests: $(FOSSIL-SCM_SUGGESTS)" >>$@
  165. @echo "Conflicts: $(FOSSIL-SCM_CONFLICTS)" >>$@
  166. #
  167. # This builds the IPK file.
  168. #
  169. # Binaries should be installed into $(FOSSIL-SCM_IPK_DIR)/opt/sbin or $(FOSSIL-SCM_IPK_DIR)/opt/bin
  170. # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
  171. # Libraries and include files should be installed into $(FOSSIL-SCM_IPK_DIR)/opt/{lib,include}
  172. # Configuration files should be installed in $(FOSSIL-SCM_IPK_DIR)/opt/etc/fossil-scm/...
  173. # Documentation files should be installed in $(FOSSIL-SCM_IPK_DIR)/opt/doc/fossil-scm/...
  174. # Daemon startup scripts should be installed in $(FOSSIL-SCM_IPK_DIR)/opt/etc/init.d/S??fossil-scm
  175. #
  176. # You may need to patch your application to make it use these locations.
  177. #
  178. $(FOSSIL-SCM_IPK): $(FOSSIL-SCM_BUILD_DIR)/.built
  179. rm -rf $(FOSSIL-SCM_IPK_DIR) $(BUILD_DIR)/fossil-scm_*_$(TARGET_ARCH).ipk
  180. # $(MAKE) -C $(FOSSIL-SCM_BUILD_DIR) DESTDIR=$(FOSSIL-SCM_IPK_DIR) install-strip
  181. install -d $(FOSSIL-SCM_IPK_DIR)/opt/bin
  182. install -m755 $(<D)/fossil $(FOSSIL-SCM_IPK_DIR)/opt/bin
  183. $(STRIP_COMMAND) $(FOSSIL-SCM_IPK_DIR)/opt/bin/fossil
  184. $(MAKE) $(FOSSIL-SCM_IPK_DIR)/CONTROL/control
  185. echo $(FOSSIL-SCM_CONFFILES) | sed -e 's/ /\n/g' > $(FOSSIL-SCM_IPK_DIR)/CONTROL/conffiles
  186. cd $(BUILD_DIR); $(IPKG_BUILD) $(FOSSIL-SCM_IPK_DIR)
  187. #
  188. # This is called from the top level makefile to create the IPK file.
  189. #
  190. fossil-scm-ipk: $(FOSSIL-SCM_IPK)
  191. #
  192. # This is called from the top level makefile to clean all of the built files.
  193. #
  194. fossil-scm-clean:
  195. rm -f $(FOSSIL-SCM_BUILD_DIR)/.built
  196. -$(MAKE) -C $(FOSSIL-SCM_BUILD_DIR) clean
  197. #
  198. # This is called from the top level makefile to clean all dynamically created
  199. # directories.
  200. #
  201. fossil-scm-dirclean:
  202. rm -rf $(BUILD_DIR)/$(FOSSIL-SCM_DIR) $(FOSSIL-SCM_BUILD_DIR) $(FOSSIL-SCM_IPK_DIR) $(FOSSIL-SCM_IPK)
  203. #
  204. #
  205. # Some sanity check for the package.
  206. #
  207. fossil-scm-check: $(FOSSIL-SCM_IPK)
  208. perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $^