Committed revision 24640

On Wed, Dec 15, 2010 at 5:38 PM, Alfred E. Heggestad <[email protected]> wrote:

> On 12/14/10 2:40 AM, Jo-Philipp Wich wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hey,
>>
>> the patch looks clean so far but I don't like the idea of conditional
>> compilation. For the initial version its okay to always mandate libspeex
>> etc. and make it a static DEPENDS:=... .
>>
>> In a later version you should maybe look into providing a "full" and
>> "mini" variant of your package, or even better, make the code parts
>> requiring speex etc. loadable libraries. Of course I cannot judge how
>> much effort this would be, but maybe consider it.
>>
>>
> Hi,
>
> thanks for your feedback, I have removed the conditional compilation as you
> mentioned, they should not be needed for this initial version ...
>
>
> the applications baresip and restund are already fully modular, and each
> module
> can either be statically linked into the main application, or loaded
> dynamically.
> I think that we can add extra packages later, to extend functionality ..
>
>
>
> Signed-Off-By: Alfred E. Heggestad <[email protected]>
> ---
> diff '--exclude=.svn' -Naur packages-orig//libs/re/Makefile
> packages/libs/re/Makefile
> --- packages-orig//libs/re/Makefile     1970-01-01 01:00:00.000000000 +0100
> +++ packages/libs/re/Makefile   2010-12-15 15:59:30.000000000 +0100
> @@ -0,0 +1,64 @@
>
> +#
> +# Makefile
> +#
> +# Copyright (C) 2010 Alfred E. Heggestad
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=re
> +PKG_VERSION:=0.1.0
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=http://www.creytiv.com/pub
> +#PKG_MD5SUM:=734892c8ca5e7e835828048a1289a0cc
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +define Package/libre
> +  SECTION:=libs
> +  CATEGORY:=Libraries
> +  DEPENDS:=+libopenssl +libpthread
> +  TITLE:=Generic library for real-time communications with async IO
> support
> +  URL:=http://www.creytiv.com/
> +endef
> +
> +define Package/libre/description
> +       Generic library for real-time communications with async IO support.
> +endef
> +
> +TARGET_CFLAGS += $(FPIC)
> +
> +define Build/Compile
> +       $(MAKE) -C $(PKG_BUILD_DIR) \
> +               HAVE_LIBRESOLV= \
>
> +               CC="$(TARGET_CC)" \
> +               EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
> +               EXTRA_LFLAGS="-lm" \
> +               DESTDIR="$(PKG_INSTALL_DIR)" \
> +               SYSROOT="$(TOOLCHAIN_DIR)" \
>
> +               SYSROOT_ALT="$(STAGING_DIR)/usr" \
> +               RELEASE=1 \
> +               all install
> +endef
> +
> +define Build/InstallDev
> +       mkdir -p $(1)/usr/include
> +       $(CP) $(PKG_INSTALL_DIR)/usr/include/re $(1)/usr/include/
> +       mkdir -p $(1)/usr/lib
> +       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.{a,so*} $(1)/usr/lib/
> +endef
> +
> +define Build/UninstallDev
> +       rm -rf \
> +               $(STAGING_DIR)/usr/include/re \
> +               $(STAGING_DIR)/usr/lib/libre.{a,so*}
> +endef
> +
> +define Package/libre/install
> +       $(INSTALL_DIR) $(1)/usr/lib
> +       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.so* $(1)/usr/lib/
> +endef
> +
> +$(eval $(call BuildPackage,libre))
> diff '--exclude=.svn' -Naur packages-orig//net/baresip/files/baresip.init
> packages/net/baresip/files/baresip.init
> --- packages-orig//net/baresip/files/baresip.init       1970-01-01
> 01:00:00.000000000 +0100
> +++ packages/net/baresip/files/baresip.init     2010-11-12
> 19:29:38.000000000 +0100
>
> @@ -0,0 +1,19 @@
> +#!/bin/sh /etc/rc.common
> +#
> +# Copyright (C) 2010 Alfred E. Heggestad
> +#
> +
> +START=92
> +BIN=baresip
> +DEFAULT=/etc/default/$BIN
> +OPTIONS=-d
> +
> +start() {
> +       [ -f $DEFAULT ] && . $DEFAULT
> +       $BIN $OPTIONS
> +}
> +
> +stop() {
> +       killall $BIN
> +}
> +
> diff '--exclude=.svn' -Naur packages-orig//net/baresip/Makefile
> packages/net/baresip/Makefile
> --- packages-orig//net/baresip/Makefile 1970-01-01 01:00:00.000000000 +0100
> +++ packages/net/baresip/Makefile       2010-12-15 16:04:52.000000000 +0100
>
> @@ -0,0 +1,56 @@
> +#
> +# Makefile
> +#
> +# Copyright (C) 2010 Alfred E. Heggestad
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=baresip
> +PKG_VERSION:=0.1.0
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=http://www.creytiv.com/pub/
> +#PKG_MD5SUM:=ee345fe605ffcfce843dae4aed81122b
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +EXTRA_DEPS :=
> +
> +define Package/baresip
> +  SECTION:=net
> +  CATEGORY:=Network
>
> +  DEPENDS:=+libre +libpthread $(EXTRA_DEPS)
> +  TITLE:=baresip Barebone SIP useragent
> +  URL:=http://www.creytiv.com/
> +endef
> +
> +define Build/Compile
> +       $(MAKE) -C $(PKG_BUILD_DIR) \
> +               MOD_AUTODETECT= \
> +               USE_G711=1 USE_L16=1 \
> +               USE_STDIO=1 USE_CONS=1 USE_EVDEV=1 \
> +               USE_OSS=1 \
> +               CC="$(TARGET_CC)" \
> +               DESTDIR="$(PKG_INSTALL_DIR)" \
> +               EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \
> +               $(PKG_MAKE_OPTS) \
> +               SYSROOT="$(TOOLCHAIN_DIR)" \
>
> +               SYSROOT_ALT="$(STAGING_DIR)/usr" \
> +               RELEASE=1 \
> +               all install
> +endef
> +
> +define Package/baresip/install
> +       $(INSTALL_DIR) $(1)/usr/bin
> +       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin/
> +       $(INSTALL_DIR) $(1)/usr/lib/baresip/modules
> +       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/*.so
> $(1)/usr/lib/baresip/modules/.
> +       $(INSTALL_DIR) $(1)/usr/share/baresip
> +       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/baresip/*
> $(1)/usr/share/baresip/.
> +       $(INSTALL_DIR) $(1)/etc/init.d
> +       $(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip
> +endef
> +
> +$(eval $(call BuildPackage,baresip))
> diff '--exclude=.svn' -Naur packages-orig//net/restund/files/restund.init
> packages/net/restund/files/restund.init
> --- packages-orig//net/restund/files/restund.init       1970-01-01
> 01:00:00.000000000 +0100
> +++ packages/net/restund/files/restund.init     2010-11-12
> 19:48:53.000000000 +0100
>
> @@ -0,0 +1,18 @@
> +#!/bin/sh /etc/rc.common
> +#
> +# Copyright (C) 2010 Alfred E. Heggestad
> +#
> +
> +START=60
> +BIN=restund
> +DEFAULT=/etc/default/$BIN
> +OPTIONS=
> +
> +start() {
> +       [ -f $DEFAULT ] && . $DEFAULT
> +       $BIN $OPTIONS
> +}
> +
> +stop() {
> +       killall $BIN
> +}
> diff '--exclude=.svn' -Naur packages-orig//net/restund/Makefile
> packages/net/restund/Makefile
> --- packages-orig//net/restund/Makefile 1970-01-01 01:00:00.000000000 +0100
> +++ packages/net/restund/Makefile       2010-12-15 16:06:16.000000000 +0100
> @@ -0,0 +1,52 @@
>
> +#
> +# Makefile
> +#
> +# Copyright (C) 2010 Alfred E. Heggestad
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=restund
> +PKG_VERSION:=0.1.0
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=http://www.creytiv.com/pub/
> +#PKG_MD5SUM:=ee345fe605ffcfce843dae4aed81122b
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +define Package/restund
> +  SECTION:=net
> +  CATEGORY:=Network
> +  DEPENDS:=+libre
>
> +  TITLE:=libre stun server
> +  URL:=http://www.creytiv.com/
> +endef
> +
> +#PKG_MAKE_OPTS += USE_MYSQL=
>
> +
> +define Build/Compile
> +       $(MAKE) -C $(PKG_BUILD_DIR) \
> +               CC="$(TARGET_CC)" \
> +               EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
> +               DESTDIR="$(PKG_INSTALL_DIR)" \
> +               $(PKG_MAKE_OPTS) \
> +               SYSROOT="$(TOOLCHAIN_DIR)" \
>
> +               SYSROOT_ALT="$(STAGING_DIR)/usr" \
> +               RELEASE=1 \
> +               all install
> +endef
> +
> +define Package/restund/install
> +       $(INSTALL_DIR) $(1)/usr/sbin
> +       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/restund $(1)/usr/sbin/
> +       $(INSTALL_DIR) $(1)/usr/lib/$(PKG_NAME)/modules
> +       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/modules/*.so
> $(1)/usr/lib/$(PKG_NAME)/modules/.
> +       $(INSTALL_DIR) $(1)/etc
> +       $(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/restund.conf $(1)/etc/
> +       $(INSTALL_DIR) $(1)/etc/init.d
> +       $(INSTALL_BIN) ./files/restund.init $(1)/etc/init.d/restund
> +endef
> +
> +$(eval $(call BuildPackage,restund))
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to