Radix cross Linux

Radix Linux distribution for embedded systems.

637 Commits   4 Branches   3 Tags
author: Andrey V.Kosteltsev <kx@radix.pro> 2016-10-20 10:59:50 +0000 committer: Andrey V.Kosteltsev <kx@radix.pro> 2016-10-20 10:59:50 +0000 commit: c10d6630d3ae594a861677982be16fb98a6bd775 parent: b0b19f02acb2827874fd2ee1b971d3e61faf30fb
Commit Summary:
TwoLAME - optimised MPEG Audio Layer 2 encoder
Diffstat:
8 files changed, 444 insertions, 1 deletion
diff --git a/app/faac/1.28/Makefile b/app/faac/1.28/Makefile
index bfbc1bd2f..f520c7a70 100644
--- a/app/faac/1.28/Makefile
+++ b/app/faac/1.28/Makefile
@@ -130,7 +130,7 @@ $(build_target): $(src_done)
 
 $(install_target): $(build_target)
 	@mkdir -p $(FAAC_PKG)
-	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install     $(env_sysroot)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
 	# ======= Install Documentation =======
 	@if [ -d $(FAAC_PKG)/usr/share/man ]; then \
 	  ( cd $(FAAC_PKG)/usr/share/man ; \
diff --git a/app/twolame/0.3.13-x86_32/Makefile b/app/twolame/0.3.13-x86_32/Makefile
new file mode 100644
index 000000000..0b72ed1a4
--- /dev/null
+++ b/app/twolame/0.3.13-x86_32/Makefile
@@ -0,0 +1,184 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/twolame
+
+REQUIRES           = app/twolame/0.3.13
+REQUIRES          += libs/libsndfile/1.0.26-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 0.3.13
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/m/twolame/twolame-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/twolame-$(version)
+src_dir_name       = twolame-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = app
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+TWOLAME_32_PKG_NAME                = twolame-x32
+TWOLAME_32_PKG_VERSION             = 0.3.13
+TWOLAME_32_PKG_ARCH                = $(TOOLCHAIN)
+TWOLAME_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+TWOLAME_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+TWOLAME_32_PKG_GROUP               = $(PKG_GROUP)
+###                                 |---handy-ruler-------------------------------|
+TWOLAME_32_PKG_SHORT_DESCRIPTION   = optimized MPEG Audio Layer 2 encoder
+TWOLAME_32_PKG_URL                 = $(BUG_URL)
+TWOLAME_32_PKG_LICENSE             = LGPLv2.1
+TWOLAME_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(TWOLAME_32_PKG_NAME)-pkg-description
+TWOLAME_32_PKG_DESCRIPTION_FILE_IN = $(TWOLAME_32_PKG_NAME)-pkg-description.in
+TWOLAME_32_PKG_INSTALL_SCRIPT      = $(TWOLAME_32_PKG_NAME)-pkg-install.sh
+
+TWOLAME_32_PKG    = $(CURDIR)/$(TARGET_BUILD_DIR)/$(TWOLAME_32_PKG_NAME)-package
+
+pkg_basename      = $(TWOLAME_32_PKG_NAME)-$(TWOLAME_32_PKG_VERSION)-$(TWOLAME_32_PKG_ARCH)-$(TWOLAME_32_PKG_DISTRO_NAME)-$(TWOLAME_32_PKG_DISTRO_VERSION)
+
+pkg_archive       = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature     = $(call sign-name,$(pkg_archive))
+pkg_description   = $(call desc-name,$(pkg_archive))
+products          = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS     = $(build_target)
+BUILD_TARGETS    += $(install_target)
+
+PRODUCT_TARGETS   = $(products)
+
+ROOTFS_TARGETS    = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(TWOLAME_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --sysconfdir=/etc
+extra_configure_switches += --localstatedir=/var
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+TARGET_BIN_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX)
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@cd $(SRC_DIR) && \
+	  $(BUILD_ENVIRONMENT) ./configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(TWOLAME_32_PKG)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(TWOLAME_32_PKG)/usr/include
+	@rm -rf $(TWOLAME_32_PKG)/usr/share
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(TWOLAME_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libtwolame.la  \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(TWOLAME_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libtwolame.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libtwolame.la \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" twolame.pc \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(TWOLAME_32_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target binaries =======
+	@( cd $(TWOLAME_32_PKG)/usr/bin/32 ; \
+	   for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(TWOLAME_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(TWOLAME_32_PKG_DESCRIPTION_FILE): $(TWOLAME_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(TWOLAME_32_PKG_DESCRIPTION_FILE) $(TWOLAME_32_PKG_INSTALL_SCRIPT)
+	@cp $(TWOLAME_32_PKG_DESCRIPTION_FILE) $(TWOLAME_32_PKG)/.DESCRIPTION
+	@cp $(TWOLAME_32_PKG_INSTALL_SCRIPT) $(TWOLAME_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(TWOLAME_32_PKG)/.REQUIRES
+	@echo "pkgname=$(TWOLAME_32_PKG_NAME)"                            >  $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(TWOLAME_32_PKG_VERSION)"                          >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(TWOLAME_32_PKG_ARCH)"                               >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(TWOLAME_32_PKG_DISTRO_NAME)"                  >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(TWOLAME_32_PKG_DISTRO_VERSION)"                >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "group=$(TWOLAME_32_PKG_GROUP)"                             >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(TWOLAME_32_PKG_SHORT_DESCRIPTION)\"" >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "url=$(TWOLAME_32_PKG_URL)"                                 >> $(TWOLAME_32_PKG)/.PKGINFO ; \
+	 echo "license=$(TWOLAME_32_PKG_LICENSE)"                         >> $(TWOLAME_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(TWOLAME_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/app/twolame/0.3.13-x86_32/PATCHES b/app/twolame/0.3.13-x86_32/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/app/twolame/0.3.13-x86_32/twolame-x32-pkg-description.in b/app/twolame/0.3.13-x86_32/twolame-x32-pkg-description.in
new file mode 100644
index 000000000..167c1e784
--- /dev/null
+++ b/app/twolame/0.3.13-x86_32/twolame-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+           |-----handy-ruler------------------------------------------------------|
+twolame-x32: twolame-x32 @VERSION@ (x86_32 optimized MPEG Audio Layer 2 encoder)
+twolame-x32:
+twolame-x32: TwoLAME should be able to be used as a drop-in replacement for
+twolame-x32: LAME (a MPEG Layer 3 encoder). The frontend takes very similar
+twolame-x32: command line options to LAME, and the backend library has
+twolame-x32: a very similar API to LAME.
+twolame-x32:
+twolame-x32:
+twolame-x32: Homepage: http://www.twolame.org
+twolame-x32:
+twolame-x32:
diff --git a/app/twolame/0.3.13-x86_32/twolame-x32-pkg-install.sh b/app/twolame/0.3.13-x86_32/twolame-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/app/twolame/0.3.13-x86_32/twolame-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/app/twolame/0.3.13/Makefile b/app/twolame/0.3.13/Makefile
new file mode 100644
index 000000000..7d46b174f
--- /dev/null
+++ b/app/twolame/0.3.13/Makefile
@@ -0,0 +1,220 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/twolame
+
+REQUIRES           = libs/libsndfile/1.0.26
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 0.3.13
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/m/twolame/twolame-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/twolame-$(version)
+src_dir_name       = twolame-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = app
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+TWOLAME_PKG_NAME                = twolame
+TWOLAME_PKG_VERSION             = 0.3.13
+TWOLAME_PKG_ARCH                = $(TOOLCHAIN)
+TWOLAME_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+TWOLAME_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+TWOLAME_PKG_GROUP               = $(PKG_GROUP)
+###                              |---handy-ruler-------------------------------|
+TWOLAME_PKG_SHORT_DESCRIPTION   = optimized MPEG Audio Layer 2 encoder
+TWOLAME_PKG_URL                 = $(BUG_URL)
+TWOLAME_PKG_LICENSE             = LGPLv2.1
+TWOLAME_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(TWOLAME_PKG_NAME)-pkg-description
+TWOLAME_PKG_DESCRIPTION_FILE_IN = $(TWOLAME_PKG_NAME)-pkg-description.in
+TWOLAME_PKG_INSTALL_SCRIPT      = $(TWOLAME_PKG_NAME)-pkg-install.sh
+
+TWOLAME_PKG      = $(CURDIR)/$(TARGET_BUILD_DIR)/$(TWOLAME_PKG_NAME)-package
+
+pkg_basename     = $(TWOLAME_PKG_NAME)-$(TWOLAME_PKG_VERSION)-$(TWOLAME_PKG_ARCH)-$(TWOLAME_PKG_DISTRO_NAME)-$(TWOLAME_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(TWOLAME_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --htmldir=/usr/share/doc/$(src_dir_name)/html
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --sysconfdir=/etc
+extra_configure_switches += --localstatedir=/var
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+TARGET_BIN_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX)
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@cd $(SRC_DIR) && \
+	  $(BUILD_ENVIRONMENT) ./configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(TWOLAME_PKG)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(TWOLAME_PKG)/usr/share/man ]; then \
+	  ( cd $(TWOLAME_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.? ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(TWOLAME_PKG)/usr/doc/$(src_dir_name)
+	@cp -a $(SRC_DIR)/AUTHORS $(SRC_DIR)/COPYING \
+	       $(TWOLAME_PKG)/usr/doc/$(src_dir_name)
+	@mkdir -p $(TWOLAME_PKG)/usr/share/doc/$(src_dir_name)/html
+	@( cd $(SRC_DIR) ; \
+	   cp -a AUTHORS COPYING README TODO \
+	         $(TWOLAME_PKG)/usr/share/doc/$(src_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r ChangeLog ]; then \
+	     DOCSDIR=`echo $(TWOLAME_PKG)/usr/share/doc/$(src_dir_name)` ; \
+	     cat ChangeLog | head -n 1000 > $$DOCSDIR/ChangeLog ; \
+	     touch -r ChangeLog $$DOCSDIR/ChangeLog ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(TWOLAME_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libtwolame.la  \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(TWOLAME_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libtwolame.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libtwolame.la \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" twolame.pc \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(TWOLAME_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target binaries =======
+	@( cd $(TWOLAME_PKG)/usr/bin ; \
+	   for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(TWOLAME_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(TWOLAME_PKG_DESCRIPTION_FILE): $(TWOLAME_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(TWOLAME_PKG_DESCRIPTION_FILE) $(TWOLAME_PKG_INSTALL_SCRIPT)
+	@cp $(TWOLAME_PKG_DESCRIPTION_FILE) $(TWOLAME_PKG)/.DESCRIPTION
+	@cp $(TWOLAME_PKG_INSTALL_SCRIPT) $(TWOLAME_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(TWOLAME_PKG)/.REQUIRES
+	@echo "pkgname=$(TWOLAME_PKG_NAME)"                            >  $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(TWOLAME_PKG_VERSION)"                          >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "arch=$(TWOLAME_PKG_ARCH)"                               >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "distroname=$(TWOLAME_PKG_DISTRO_NAME)"                  >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "distrover=$(TWOLAME_PKG_DISTRO_VERSION)"                >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "group=$(TWOLAME_PKG_GROUP)"                             >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(TWOLAME_PKG_SHORT_DESCRIPTION)\"" >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "url=$(TWOLAME_PKG_URL)"                                 >> $(TWOLAME_PKG)/.PKGINFO ; \
+	 echo "license=$(TWOLAME_PKG_LICENSE)"                         >> $(TWOLAME_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(TWOLAME_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/app/twolame/0.3.13/PATCHES b/app/twolame/0.3.13/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/app/twolame/0.3.13/twolame-pkg-description.in b/app/twolame/0.3.13/twolame-pkg-description.in
new file mode 100644
index 000000000..cc5ad30b5
--- /dev/null
+++ b/app/twolame/0.3.13/twolame-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+       |-----handy-ruler------------------------------------------------------|
+twolame: twolame @VERSION@ (optimized MPEG Audio Layer 2 encoder)
+twolame:
+twolame: TwoLAME should be able to be used as a drop-in replacement for
+twolame: LAME (a MPEG Layer 3 encoder). The frontend takes very similar
+twolame: command line options to LAME, and the backend library has
+twolame: a very similar API to LAME.
+twolame:
+twolame:
+twolame: Homepage: http://www.twolame.org
+twolame:
+twolame:
diff --git a/app/twolame/0.3.13/twolame-pkg-install.sh b/app/twolame/0.3.13/twolame-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/app/twolame/0.3.13/twolame-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/sources/packages/m/twolame/Makefile b/sources/packages/m/twolame/Makefile
new file mode 100644
index 000000000..dab2d52eb
--- /dev/null
+++ b/sources/packages/m/twolame/Makefile
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/packages/m/twolame
+
+versions    = 0.3.13
+pkgname     = twolame
+suffix      = tar.gz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) -i & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) -i & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)