Advertisement
alllexx

Untitled

Mar 7th, 2011
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 9.58 KB | None | 0 0
  1. ###########################################################
  2. #
  3. # fuppes
  4. #
  5. ###########################################################
  6. #
  7. # FUPPES_VERSION, FUPPES_SITE and FUPPES_SOURCE define
  8. # the upstream location of the source code for the package.
  9. # FUPPES_DIR is the directory which is created when the source
  10. # archive is unpacked.
  11. # FUPPES_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. FUPPES_SITE=http://$(SOURCEFORGE_MIRROR)/sourceforge/fuppes
  24. FUPPES_VERSION=SVN-660
  25. FUPPES_SOURCE=fuppes-0.$(shell echo "$(FUPPES_VERSION)"|cut -d "-" -f 2).tar.gz
  26. FUPPES_DIR=fuppes-0.$(shell echo "$(FUPPES_VERSION)"|cut -d "-" -f 2)
  27. FUPPES_UNZIP=zcat
  28. FUPPES_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
  29. FUPPES_DESCRIPTION=FUPPES is a free, multiplatform UPnP (TM) A/V MediaServer, \
  30. with optional on-the-fly audio transcondig from ogg/vorbis, mpc/musepack and FLAC to mp3.
  31. FUPPES_SECTION=audio
  32. FUPPES_PRIORITY=optional
  33. FUPPES_DEPENDS=e2fslibs, ffmpeg, libxml2, pcre, sqlite
  34. ifeq (taglib, $(filter taglib, $(PACKAGES)))
  35. FUPPES_DEPENDS+=, taglib
  36. endif
  37. ifeq (libiconv, $(filter libiconv, $(PACKAGES)))
  38. FUPPES_DEPENDS+=, libiconv
  39. endif
  40. FUPPES_SUGGESTS=
  41. FUPPES_CONFLICTS=
  42.  
  43. #
  44. # FUPPES_IPK_VERSION should be incremented when the ipk changes.
  45. #
  46. FUPPES_IPK_VERSION=1
  47.  
  48. #
  49. # FUPPES_CONFFILES should be a list of user-editable files
  50. #FUPPES_CONFFILES=/opt/etc/fuppes.conf /opt/etc/init.d/SXXfuppes
  51.  
  52. #
  53. # FUPPES_PATCHES should list any patches, in the the order in
  54. # which they should be applied to the source code.
  55. #
  56. FUPPES_PATCHES=
  57. ifeq (libiconv, $(filter libiconv, $(PACKAGES)))
  58. #FUPPES_PATCHES=$(FUPPES_SOURCE_DIR)/libiconv.patch
  59. endif
  60. ifneq ($(HOSTCC), $(TARGET_CC))
  61. FUPPES_PATCHES+=$(FUPPES_SOURCE_DIR)/configure.patch
  62. endif
  63. #FUPPES_PATCHES+=$(FUPPES_SOURCE_DIR)/atoll-not-a-member-of-std.patch
  64.  
  65. #
  66. # If the compilation of the package requires additional
  67. # compilation or linking flags, then list them here.
  68. #
  69. FUPPES_CPPFLAGS=-I$(STAGING_INCLUDE_DIR)/ffmpeg
  70. FUPPES_LDFLAGS=
  71. ifeq (libiconv, $(filter libiconv, $(PACKAGES)))
  72. FUPPES_LDFLAGS+=-liconv
  73. endif
  74.  
  75. #
  76. # FUPPES_BUILD_DIR is the directory in which the build is done.
  77. # FUPPES_SOURCE_DIR is the directory which holds all the
  78. # patches and ipkg control files.
  79. # FUPPES_IPK_DIR is the directory in which the ipk is built.
  80. # FUPPES_IPK is the name of the resulting ipk files.
  81. #
  82. # You should not change any of these variables.
  83. #
  84. FUPPES_BUILD_DIR=$(BUILD_DIR)/fuppes
  85. FUPPES_SOURCE_DIR=$(SOURCE_DIR)/fuppes
  86. FUPPES_IPK_DIR=$(BUILD_DIR)/fuppes-$(FUPPES_VERSION)-ipk
  87. FUPPES_IPK=$(BUILD_DIR)/fuppes_$(FUPPES_VERSION)-$(FUPPES_IPK_VERSION)_$(TARGET_ARCH).ipk
  88.  
  89. ifeq (taglib, $(filter taglib, $(PACKAGES)))
  90. FUPPES_WITH_TAGLIB=TAGLIB_CONFIG=$(STAGING_PREFIX)/bin/taglib-config
  91. else
  92. FUPPES_WITH_TAGLIB=ac_cv_path_TAGLIB_CONFIG=no
  93. endif
  94.  
  95. .PHONY: fuppes-source fuppes-unpack fuppes fuppes-stage fuppes-ipk fuppes-clean fuppes-dirclean fuppes-check
  96.  
  97. #
  98. # This is the dependency on the source code.  If the source is missing,
  99. # then it will be fetched from the site using wget.
  100. #
  101. $(DL_DIR)/$(FUPPES_SOURCE):
  102.     $(WGET) -P $(@D) $(FUPPES_SITE)/$(@F) || \
  103.     $(WGET) -P $(@D) $(SOURCES_NLO_SITE)/$(@F)
  104.  
  105. #
  106. # The source code depends on it existing within the download directory.
  107. # This target will be called by the top level Makefile to download the
  108. # source code's archive (.tar.gz, .bz2, etc.)
  109. #
  110. fuppes-source: $(DL_DIR)/$(FUPPES_SOURCE) $(FUPPES_PATCHES)
  111.  
  112. #
  113. # This target unpacks the source code in the build directory.
  114. # If the source archive is not .tar.gz or .tar.bz2, then you will need
  115. # to change the commands here.  Patches to the source code are also
  116. # applied in this target as required.
  117. #
  118. # This target also configures the build within the build directory.
  119. # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
  120. # and NOT $(MAKE) below.  Passing it to configure causes configure to
  121. # correctly BUILD the Makefile with the right paths, where passing it
  122. # to Make causes it to override the default search paths of the compiler.
  123. #
  124. # If the compilation of the package requires other packages to be staged
  125. # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
  126. #
  127. # If the package uses  GNU libtool, you should invoke $(PATCH_LIBTOOL) as
  128. # shown below to make various patches to it.
  129. #
  130. $(FUPPES_BUILD_DIR)/.configured: $(DL_DIR)/$(FUPPES_SOURCE) $(FUPPES_PATCHES) make/fuppes.mk
  131.     $(MAKE) e2fsprogs-stage
  132.     $(MAKE) libxml2-stage
  133.     $(MAKE) pcre-stage
  134.     $(MAKE) sqlite-stage
  135.     $(MAKE) ffmpeg-stage
  136. ifeq (taglib, $(filter taglib, $(PACKAGES)))
  137.     $(MAKE) taglib-stage
  138. endif
  139. ifeq (libiconv, $(filter libiconv, $(PACKAGES)))
  140.     $(MAKE) libiconv-stage
  141. endif
  142.     rm -rf $(BUILD_DIR)/$(FUPPES_DIR) $(FUPPES_BUILD_DIR)
  143.     $(FUPPES_UNZIP) $(DL_DIR)/$(FUPPES_SOURCE) | tar -C $(BUILD_DIR) -xvf -
  144.     if test -n "$(FUPPES_PATCHES)" ; \
  145.         then cat $(FUPPES_PATCHES) | \
  146.         patch -d $(BUILD_DIR)/$(FUPPES_DIR) -p0 ; \
  147.     fi
  148.     if test "$(BUILD_DIR)/$(FUPPES_DIR)" != "$(FUPPES_BUILD_DIR)" ; \
  149.         then mv $(BUILD_DIR)/$(FUPPES_DIR) $(FUPPES_BUILD_DIR) ; \
  150.     fi
  151.     (cd $(@D); \
  152.         $(TARGET_CONFIGURE_OPTS) \
  153.         CPPFLAGS="$(STAGING_CPPFLAGS) $(FUPPES_CPPFLAGS)" \
  154.         LDFLAGS="$(STAGING_LDFLAGS) $(FUPPES_LDFLAGS)" \
  155.         PKG_CONFIG_PATH=$(STAGING_LIB_DIR)/pkgconfig \
  156.         $(FUPPES_WITH_TAGLIB) \
  157.         ./configure \
  158.         --build=$(GNU_HOST_NAME) \
  159.         --host=$(GNU_TARGET_NAME) \
  160.         --target=$(GNU_TARGET_NAME) \
  161.         --prefix=/opt \
  162.         --sysconfdir=/opt/etc \
  163.         --disable-lame \
  164.         --disable-twolame \
  165.         --disable-nls \
  166.         --disable-static \
  167.     )
  168.     sed -i -e 's|-I/opt/include | |g' $(@D)/Makefile $(@D)/src/Makefile
  169.     $(PATCH_LIBTOOL) $(@D)/libtool
  170.     touch $@
  171.  
  172. fuppes-unpack: $(FUPPES_BUILD_DIR)/.configured
  173.  
  174. #
  175. # This builds the actual binary.
  176. #
  177. $(FUPPES_BUILD_DIR)/.built: $(FUPPES_BUILD_DIR)/.configured
  178.     rm -f $@
  179.     $(MAKE) -C $(@D)
  180.     touch $@
  181.  
  182. #
  183. # This is the build convenience target.
  184. #
  185. fuppes: $(FUPPES_BUILD_DIR)/.built
  186.  
  187. #
  188. # If you are building a library, then you need to stage it too.
  189. #
  190. $(FUPPES_BUILD_DIR)/.staged: $(FUPPES_BUILD_DIR)/.built
  191.     rm -f $@
  192.     $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
  193.     touch $@
  194.  
  195. fuppes-stage: $(FUPPES_BUILD_DIR)/.staged
  196.  
  197. #
  198. # This rule creates a control file for ipkg.  It is no longer
  199. # necessary to create a seperate control file under sources/fuppes
  200. #
  201. $(FUPPES_IPK_DIR)/CONTROL/control:
  202.     @install -d $(@D)
  203.     @rm -f $@
  204.     @echo "Package: fuppes" >>$@
  205.     @echo "Architecture: $(TARGET_ARCH)" >>$@
  206.     @echo "Priority: $(FUPPES_PRIORITY)" >>$@
  207.     @echo "Section: $(FUPPES_SECTION)" >>$@
  208.     @echo "Version: $(FUPPES_VERSION)-$(FUPPES_IPK_VERSION)" >>$@
  209.     @echo "Maintainer: $(FUPPES_MAINTAINER)" >>$@
  210.     @echo "Source: $(FUPPES_SITE)/$(FUPPES_SOURCE)" >>$@
  211.     @echo "Description: $(FUPPES_DESCRIPTION)" >>$@
  212.     @echo "Depends: $(FUPPES_DEPENDS)" >>$@
  213.     @echo "Suggests: $(FUPPES_SUGGESTS)" >>$@
  214.     @echo "Conflicts: $(FUPPES_CONFLICTS)" >>$@
  215.  
  216. #
  217. # This builds the IPK file.
  218. #
  219. # Binaries should be installed into $(FUPPES_IPK_DIR)/opt/sbin or $(FUPPES_IPK_DIR)/opt/bin
  220. # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
  221. # Libraries and include files should be installed into $(FUPPES_IPK_DIR)/opt/{lib,include}
  222. # Configuration files should be installed in $(FUPPES_IPK_DIR)/opt/etc/fuppes/...
  223. # Documentation files should be installed in $(FUPPES_IPK_DIR)/opt/doc/fuppes/...
  224. # Daemon startup scripts should be installed in $(FUPPES_IPK_DIR)/opt/etc/init.d/S??fuppes
  225. #
  226. # You may need to patch your application to make it use these locations.
  227. #
  228. $(FUPPES_IPK): $(FUPPES_BUILD_DIR)/.built
  229.     rm -rf $(FUPPES_IPK_DIR) $(BUILD_DIR)/fuppes_*_$(TARGET_ARCH).ipk
  230.     $(MAKE) -C $(FUPPES_BUILD_DIR) DESTDIR=$(FUPPES_IPK_DIR) install-strip
  231. #   install -d $(FUPPES_IPK_DIR)/opt/etc/
  232. #   install -m 644 $(FUPPES_SOURCE_DIR)/fuppes.conf $(FUPPES_IPK_DIR)/opt/etc/fuppes.conf
  233. #   install -d $(FUPPES_IPK_DIR)/opt/etc/init.d
  234. #   install -m 755 $(FUPPES_SOURCE_DIR)/rc.fuppes $(FUPPES_IPK_DIR)/opt/etc/init.d/SXXfuppes
  235. #   sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(FUPPES_IPK_DIR)/opt/etc/init.d/SXXfuppes
  236.     $(MAKE) $(FUPPES_IPK_DIR)/CONTROL/control
  237. #   install -m 755 $(FUPPES_SOURCE_DIR)/postinst $(FUPPES_IPK_DIR)/CONTROL/postinst
  238. #   sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(FUPPES_IPK_DIR)/CONTROL/postinst
  239. #   install -m 755 $(FUPPES_SOURCE_DIR)/prerm $(FUPPES_IPK_DIR)/CONTROL/prerm
  240. #   sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(FUPPES_IPK_DIR)/CONTROL/prerm
  241.     echo $(FUPPES_CONFFILES) | sed -e 's/ /\n/g' > $(FUPPES_IPK_DIR)/CONTROL/conffiles
  242.     cd $(BUILD_DIR); $(IPKG_BUILD) $(FUPPES_IPK_DIR)
  243.  
  244. #
  245. # This is called from the top level makefile to create the IPK file.
  246. #
  247. fuppes-ipk: $(FUPPES_IPK)
  248.  
  249. #
  250. # This is called from the top level makefile to clean all of the built files.
  251. #
  252. fuppes-clean:
  253.     rm -f $(FUPPES_BUILD_DIR)/.built
  254.     -$(MAKE) -C $(FUPPES_BUILD_DIR) clean
  255.  
  256. #
  257. # This is called from the top level makefile to clean all dynamically created
  258. # directories.
  259. #
  260. fuppes-dirclean:
  261.     rm -rf $(BUILD_DIR)/$(FUPPES_DIR) $(FUPPES_BUILD_DIR) $(FUPPES_IPK_DIR) $(FUPPES_IPK)
  262. #
  263. #
  264. # Some sanity check for the package.
  265. #
  266. fuppes-check: $(FUPPES_IPK)
  267.     perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(FUPPES_IPK)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement