fine tune package, add example conf
[openwrt.git] / openwrt / package / avahi / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=avahi
6 PKG_VERSION:=0.1
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=1ccbbc46d2aedf0c864b94c58ea220e6
9
10 PKG_SOURCE_URL:=http://www.freedesktop.org/~lennart/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(TOPDIR)/package/rules.mk
18
19 $(eval $(call PKG_template,AVAHI_DAEMON,avahi-daemon,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20 $(eval $(call PKG_template,AVAHI_DNSCONFD,avahi-dnsconfd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
21 $(eval $(call PKG_template,LIBAVAHI,libavahi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22
23 $(PKG_BUILD_DIR)/.configured:
24 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
25 $(TARGET_CONFIGURE_OPTS) \
26 CFLAGS="$(TARGET_CFLAGS) -DNDEBUG" \
27 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
28 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
29 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
30 ac_cv_func_malloc_0_nonnull=yes \
31 ac_cv_func_realloc_0_nonnull=yes \
32 ./configure \
33 --target=$(GNU_TARGET_NAME) \
34 --host=$(GNU_TARGET_NAME) \
35 --build=$(GNU_HOST_NAME) \
36 --program-prefix="" \
37 --program-suffix="" \
38 --prefix=/usr \
39 --exec-prefix=/usr \
40 --bindir=/usr/bin \
41 --datadir=/usr/share \
42 --includedir=/usr/include \
43 --infodir=/usr/share/info \
44 --libdir=/usr/lib \
45 --libexecdir=/usr/lib \
46 --localstatedir=/var \
47 --mandir=/usr/share/man \
48 --sbindir=/usr/sbin \
49 --sysconfdir=/etc \
50 $(DISABLE_LARGEFILE) \
51 $(DISABLE_NLS) \
52 --enable-shared \
53 --enable-static \
54 --disable-rpath \
55 --with-gnu-ld \
56 --disable-glib \
57 --disable-gtk \
58 --disable-dbus \
59 --enable-expat \
60 --enable-libdaemon \
61 --disable-python \
62 --disable-doxygen-doc \
63 --disable-doxygen-dot \
64 --disable-doxygen-html \
65 --disable-doxygen-ps \
66 --disable-doxygen-pdf \
67 --disable-xmltoman \
68 --with-distro=openwrt \
69 --with-avahi-user=nobody \
70 --with-avahi-group=nogroup \
71 );
72 touch $@
73
74 $(PKG_BUILD_DIR)/.built:
75 rm -rf $(PKG_INSTALL_DIR)
76 mkdir -p $(PKG_INSTALL_DIR)
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
79 all install
80 touch $@
81
82 $(IPKG_AVAHI_DAEMON):
83 install -d -m0755 $(IDIR_AVAHI_DAEMON)/etc/avahi
84 install -m0644 ./files/avahi-daemon.conf $(IDIR_AVAHI_DAEMON)/etc/avahi/
85 install -d -m0755 $(IDIR_AVAHI_DAEMON)/etc/avahi/services
86 install -m0644 ./files/service-http $(IDIR_AVAHI_DAEMON)/etc/avahi/services/http.service
87 install -m0644 ./files/service-ssh $(IDIR_AVAHI_DAEMON)/etc/avahi/services/ssh.service
88 install -d -m0755 $(IDIR_AVAHI_DAEMON)/etc/init.d
89 install -m0755 ./files/avahi-daemon.init $(IDIR_AVAHI_DAEMON)/etc/init.d/avahi-daemon
90 install -d -m0755 $(IDIR_AVAHI_DAEMON)/usr/sbin
91 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(IDIR_AVAHI_DAEMON)/usr/sbin/
92 $(RSTRIP) $(IDIR_AVAHI_DAEMON)
93 $(IPKG_BUILD) $(IDIR_AVAHI_DAEMON) $(PACKAGE_DIR)
94
95 $(IPKG_AVAHI_DNSCONFD):
96 install -d -m0755 $(IDIR_AVAHI_DNSCONFD)/etc/avahi
97 cp -fpR $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(IDIR_AVAHI_DNSCONFD)/etc/avahi/
98 install -d -m0755 $(IDIR_AVAHI_DNSCONFD)/usr/sbin
99 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(IDIR_AVAHI_DNSCONFD)/usr/sbin/
100 $(RSTRIP) $(IDIR_AVAHI_DNSCONFD)
101 $(IPKG_BUILD) $(IDIR_AVAHI_DNSCONFD) $(PACKAGE_DIR)
102
103 $(IPKG_LIBAVAHI):
104 install -d -m0755 $(IDIR_LIBAVAHI)/usr/lib
105 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libavahi-common.so.* $(IDIR_LIBAVAHI)/usr/lib/
106 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libavahi-core.so.* $(IDIR_LIBAVAHI)/usr/lib/
107 $(RSTRIP) $(IDIR_LIBAVAHI)
108 $(IPKG_BUILD) $(IDIR_LIBAVAHI) $(PACKAGE_DIR)
109
110 $(STAGING_DIR)/usr/lib/avahi.so: $(PKG_BUILD_DIR)/.built
111 mkdir -p $(STAGING_DIR)/usr/include
112 cp -fpR $(PKG_INSTALL_DIR)/usr/include/avahi-common $(STAGING_DIR)/usr/include/
113 cp -fpR $(PKG_INSTALL_DIR)/usr/include/avahi-core $(STAGING_DIR)/usr/include/
114 mkdir -p $(STAGING_DIR)/usr/lib
115 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libavahi-common.a $(STAGING_DIR)/usr/lib/
116 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libavahi-common.so* $(STAGING_DIR)/usr/lib/
117 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libavahi-core.a $(STAGING_DIR)/usr/lib/
118 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libavahi-core.so* $(STAGING_DIR)/usr/lib/
119 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
120 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(STAGING_DIR)/usr/lib/pkgconfig/
121 $(SED) 's,-I$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
122 $(SED) 's,-L$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
123 touch $@
124
125 install-dev: $(STAGING_DIR)/usr/lib/avahi.so
126
127 uninstall-dev:
128 rm -rf \
129 $(STAGING_DIR)/usr/include/avahi-common \
130 $(STAGING_DIR)/usr/include/avahi-core \
131 $(STAGING_DIR)/usr/lib/libavahi-common.a \
132 $(STAGING_DIR)/usr/lib/libavahi-common.so* \
133 $(STAGING_DIR)/usr/lib/libavahi-core.a \
134 $(STAGING_DIR)/usr/lib/libavahi-core.so* \
135 $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc \
136
137 compile: install-dev
138 clean: uninstall-dev
139
140 mostlyclean:
141 -$(MAKE) -C $(PKG_BUILD_DIR) clean
142 rm -f $(PKG_BUILD_DIR)/.built
143
This page took 0.056168 seconds and 5 git commands to generate.