use Build/Configure/Default macro, Makefile cleanup
[openwrt/svn-archive/archive.git] / libs / libxslt / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libxslt
12 PKG_VERSION:=1.1.14
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://xmlsoft.org/sources/ \
17 ftp://fr.rpmfind.net/pub/libxml/
18 PKG_MD5SUM:=db71660bb7d01ccd4e6be990af8d813b
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libxslt
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+libxml2
30 TITLE:=Gnome XSLT library
31 DESCRIPTION:=\
32 A library for XML transformation using XSLT.
33 URL:=http://xmlsoft.org/XSLT/
34 endef
35
36 define Build/Configure
37 $(call Build/Configure/Default, \
38 --enable-shared \
39 --enable-static \
40 --with-libxml-prefix="$(STAGING_DIR)/usr" \
41 --with-libxml-include-prefix="$(STAGING_DIR)/usr/include" \
42 --with-libxml-libs-prefix="$(STAGING_DIR)/usr/lib" \
43 --without-python \
44 --without-crypto \
45 --without-debug \
46 --without-mem-debug \
47 --without-debugger \
48 , \
49 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2" \
50 )
51 endef
52
53 define Build/Compile
54 $(MAKE) -C $(PKG_BUILD_DIR) \
55 DESTDIR="$(PKG_INSTALL_DIR)" \
56 all install
57 endef
58
59 define Build/InstallDev
60 mkdir -p $(STAGING_DIR)/usr/bin
61 $(CP) $(PKG_INSTALL_DIR)/usr/bin/xslt-config $(STAGING_DIR)/usr/bin/
62 mkdir -p $(STAGING_DIR)/usr/include
63 $(CP) $(PKG_INSTALL_DIR)/usr/include/libxslt $(STAGING_DIR)/usr/include/
64 mkdir -p $(STAGING_DIR)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxslt.{a,so*} $(STAGING_DIR)/usr/lib/
66 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
67 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxslt.pc $(STAGING_DIR)/usr/lib/pkgconfig/
68 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/bin/xslt-config
69 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/bin/xslt-config
70 $(SED) 's,-I$(STAGING_DIR)/usr/include,,g' $(STAGING_DIR)/usr/bin/xslt-config
71 $(SED) 's,-L$(STAGING_DIR)/usr/lib,,g' $(STAGING_DIR)/usr/bin/xslt-config
72 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxslt.pc
73 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxslt.pc
74 $(SED) 's,-I$(STAGING_DIR)/usr/include,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxslt.pc
75 $(SED) 's,-L$(STAGING_DIR)/usr/lib,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxslt.pc
76 endef
77
78 define Build/UninstallDev
79 rm -rf \
80 $(STAGING_DIR)/usr/bin/xslt-config \
81 $(STAGING_DIR)/usr/include/libxslt \
82 $(STAGING_DIR)/usr/lib/libxslt.{a,so*} \
83 $(STAGING_DIR)/usr/lib/pkgconfig/libxslt.pc
84 endef
85
86 define Package/libxslt/install
87 install -d -m0755 $(1)/usr/lib
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxslt.so.* $(1)/usr/lib/
89 endef
90
91 $(eval $(call BuildPackage,libxslt))