first commit
[scm/bb/meta-tizen.git] / recipes-tizen / python-rpm / python-rpm.inc
1 DESCRIPTION = "Python Bindings for Manipulating RPM Packages"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Base/Package Management"
4 LICENSE = "GPL-2.0+"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by python-rpm 
13 PROVIDES += "python-rpm"
14 RPROVIDES_python-rpm += "python-rpm"
15
16 RDEPENDS = ""
17 #RDEPENDS of python-rpm (${PN})
18 RDEPENDS_${PN} += "rpm"
19
20
21 DEPENDS = ""
22 #DEPENDS of python-rpm 
23 DEPENDS += "zlib-devel"
24 DEPENDS += "bzip2"
25 DEPENDS += "xz-devel"
26 DEPENDS += "uthash-devel"
27 DEPENDS += "ncurses"
28 DEPENDS += "libxml2"
29 DEPENDS += "elfutils"
30 DEPENDS += "attr"
31 #Replace "DEPENDS" on gettext by "inherit gettext"
32 inherit gettext
33 DEPENDS += "acl"
34 DEPENDS += "lua-native"
35 DEPENDS += "libtool-cross"
36 DEPENDS += "file"
37 DEPENDS += "popt"
38 DEPENDS += "libcap"
39 DEPENDS += "nss"
40 DEPENDS += "pkgconfig(libsmack)"
41 inherit pythonnative
42
43 do_patch() {
44  chmod -Rf a+rX,u+w,g-w,o-w ${S}
45  #setup -q -n rpm-4.11.0.1
46  
47  
48  
49 }
50
51 do_configure() {
52 }
53
54 do_compile() {
55  LANG=C
56  export LANG
57  unset DISPLAY
58  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
59  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
60  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
61  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
62  
63  
64  
65  
66  
67 }
68
69 do_install() {
70  echo export RPM_BUILD_ROOT=${D}
71  LANG=C
72  export LANG
73  unset DISPLAY
74  rm -rf ${D} 
75  mkdir -p ${D} 
76  
77  mkdir -p ${D}/usr/lib
78  # only installing in python/ does not work because rpm links against
79  # installed libs at install time
80  
81    oe_runmake \
82          DESTDIR=${D} \
83          INSTALL_ROOT=${D} \
84          BINDIR=/usr/bin \
85    install  
86    rm -f ${D}/usr/share/info/dir 
87    find ${D} -regex ".*\.la$" | xargs rm -f -- 
88    find ${D} -regex ".*\.a$" | xargs rm -f --
89  find ${D} -not -type d -and -not -path ${D}/usr/lib/python*/site-packages/rpm/\* -print0 | xargs -0 rm
90  pushd ${D}//usr/lib/python*/site-packages/rpm
91  rm -f _rpmmodule.a _rpmmodule.la
92  #python /usr/lib/python*/py_compile.py *.py
93  #python -O /usr/lib/python*/py_compile.py *.py
94  popd
95  
96  
97 }
98
99 PACKAGES = ""
100 PACKAGES += "python-rpm"
101
102 python-rpm_files = ""
103 python-rpm_files += "/usr/lib/python*/*/*"
104
105 FILES_${PN} = "${python-rpm_files}"
106
107 PKG_python-rpm= "python-rpm"
108
109 require python-rpm-extraconf.inc