summaryrefslogtreecommitdiff
path: root/recipes-tizen/rpm/rpm-extraconf.inc
blob: bc7fd7cc8a05faa0b74c647525d3b0cfc40a65b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
SRC_URI += "file://disable_debuginfo.patch \
            file://disable_shortcircuited.patch \
            file://fix_libdir.patch \
            file://rpm-scriptetexechelp.patch \
            file://fix-python-rpm-conf.patch \
            file://rpmmodule.c.patch \
            file://python-rpm.Makefile.am.patch \
            file://pythondeps.sh \
           "

DEPENDS += "popt-native"
DEPENDS += "uthash-native"
DEPENDS += "smack-native"
DEPENDS += "acl-native"
DEPENDS += "lua-native"
DEPENDS += "python-native"
DEPENDS_remove = "make"

DEPENDS_append_class-native = " libcap-native"
DEPENDS_append_class-target = " libcap"

CFLAGS_append = " -DRPM_VENDOR_OE "

#BBCLASSEXTEND += " nativesdk "

do_compile_prepend() {
 cd ${S}
 LANG=C
 export LANG
 unset DISPLAY
 LD_AS_NEEDED=1; export LD_AS_NEEDED ;

 ### BUILD BEGIN ###
 CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
 export CPPFLAGS
 export LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic-functions -ffunction-sections"

 export CCFLAGS="${CCFLAGS} -fPIC "
 export CXXFLAGS="${CXXFLAGS} -fPIC "
 export CFLAGS="${CFLAGS} -fPIC "

 cd db3
 ./configure --build=${TARGET_SYS} --host=x86_64-linux-gnu
 cd ..

 cp db3/configure  db3/configure.ac

 export CFLAGS="${CFLAGS} -DRPM_VENDOR_OE "
}

do_compile() {
 cd ${S}
  LANG=C
  export LANG
  unset DISPLAY
  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
  
  CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
  export CPPFLAGS
  export CFLAGS="$CFLAGS -ffunction-sections"
  export LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic-functions -ffunction-sections"
  
  export CFLAGS="${CFLAGS} -DRPM_VENDOR_OE "
  autoreconf -i -f
  oe_runconf
  
  make ${PARALLEL_MAKE}
}

EXTRA_OECONF += " --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} "
EXTRA_OECONF += " --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages "
#EXTRA_OECONF += " --host=tizen-linux "

do_install() {
 echo export RPM_BUILD_ROOT=${D}
 cd ${S}
 LANG=C
 export LANG
 unset DISPLAY
 rm -rf ${D}
 mkdir -p ${D}

 mkdir -p ${D}${prefix}/lib
 mkdir -p ${D}${prefix}/share/locale
 ln -s ../share/locale ${D}${prefix}/lib/locale

   oe_runmake \
         DESTDIR=${D} \
         INSTALL_ROOT=${D} \
         BINDIR=${prefix}/bin \
   install
   rm -f ${D}${infodir}/dir
   find ${D} -regex ".*\.la$" | xargs rm -f --
   find ${D} -regex ".*\.a$" | xargs rm -f --
 install -m 644 db3/db.h ${D}${prefix}/include/rpm
 mkdir -p ${D}${sysconfdir}/rpm
 cp -a tizen_macros ${D}${prefix}/lib/rpm
 mkdir -p ${D}${prefix}/lib/rpm/tizen
 install -m 755 ${S}/packaging/find-docs.sh ${D}${prefix}/lib/rpm/tizen
 install -m 755 ${S}/packaging/find-provides.ksyms ${D}${prefix}/lib/rpm
 install -m 644 ${S}/packaging/device-sec-policy ${D}${sysconfdir}/device-sec-policy
 install -m 644 ${S}/packaging/device-sec-policy ${D}${prefix}/lib/rpm-plugins/msm-device-sec-policy
 ln -s ../tizen_macros ${D}${prefix}/lib/rpm/tizen/macros
 for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
   mkdir -p ${D}${prefix}/src/packages/$d
   chmod 755 ${D}${prefix}/src/packages/$d
 done
 for d in ${D}${prefix}/lib/rpm/platform/*-linux/macros ; do
   dd=${d%-linux/macros}
   dd=${dd##*/}
   mkdir -p ${D}${prefix}/src/packages/RPMS/$dd
   chmod 755 ${D}${prefix}/src/packages/RPMS/$dd
 done
 mkdir -p ${D}${localstatedir}/lib/rpm
 gzip -9 ${D}${mandir}/man[18]/*.[18]
 export RPM_BUILD_ROOT
 chmod 755 doc/manual
 rm -rf doc/manual/Makefile*
 rm -f ${D}${prefix}/lib/rpmpopt
 rm -rf ${D}${mandir}/{fr,ja,ko,pl,ru,sk}
 rm -f ${D}${prefix}/share/locale/de/LC_MESSAGES/rpm.mo
 rm -f ${D}${prefix}/lib/rpm/cpanflute ${D}${prefix}/lib/rpm/cpanflute2
 install -m 755 scripts/find-supplements{,.ksyms} ${D}${prefix}/lib/rpm
 install -m 755 scripts/firmware.prov ${D}${prefix}/lib/rpm
 install -m 755 scripts/debuginfo.prov ${D}${prefix}/lib/rpm
 rm -f ${D}${prefix}/lib/locale ${D}${prefix}/lib/rpmrc
 mkdir -p ${D}${sysconfdir}/rpm
 chmod 755 ${D}${sysconfdir}/rpm
 mkdir -p ${D}${prefix}/lib/rpm/macros.d
 # remove some nonsense or non-working scripts
 pushd ${D}${prefix}/lib/rpm/
 for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
          magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
          brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
          rpmdb_* brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
 do
     rm -f $f
 done
 for i in ${prefix}/share/automake-*/*; do
   if test -f "$i" && test -f "${i##*/}"; then
     rm -f "${i##*/}"
   fi
 done
 popd
 rm -f ${D}${prefix}/lib/*.la
 rm -f ${D}${prefix}/lib/rpm-plugins/*.la


  _target="";
  _symlinks=0;

 #sh ${D}${prefix}/lib/rpm/find-lang.sh ${D} rpm



}



do_install_append() {
 rm -fr ${D}/var/tmp
 rm -fr ${D}/var/volatile

 mkdir -p ${D}${prefix}/lib/rpm/bin
 ln -s ../debugedit ${D}${prefix}/lib/rpm/bin/debugedit
 ln -s ../rpmdeps ${D}${prefix}/lib/rpm/bin/rpmdeps-oecore
}

FILES_${PN}-dbg += "\
    ${libdir}/rpm-plugins/.debug/* \
    ${libdir}/python2.7/site-packages/rpm/.debug/* \
    "

PROVIDES += " python-rpm "

DEPENDS_native += "popt-native"
DEPENDS_native += "uthash-native"
DEPENDS_native += "smack-native"