first commit
[scm/bb/meta-tizen.git] / recipes-tizen / perl-Net-DBus / perl-Net-DBus.inc
1 DESCRIPTION = "Perl extension for the DBus message system"
2 HOMEPAGE = "http://search.cpan.org/dist/Net-DBus/"
3 SECTION = "Development/Libraries"
4 LICENSE = "GPL-2.0+"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by perl-Net-DBus 
13 PROVIDES += "perl-Net-DBus"
14 RPROVIDES_perl-Net-DBus += "perl-Net-DBus"
15
16 RDEPENDS = ""
17 #RDEPENDS of perl-Net-DBus (${PN})
18 RDEPENDS_${PN} += "perl(XML::Twig)"
19
20
21 DEPENDS = ""
22 #DEPENDS of perl-Net-DBus 
23 DEPENDS += "perl(Test::Pod)"
24 DEPENDS += "perl(XML::Twig)"
25 DEPENDS += "pkgconfig(dbus-1)"
26 DEPENDS += "pkgconfig(pkg-config)"
27 inherit perlnative
28 DEPENDS += "perl(Test::Pod::Coverage)"
29
30 do_patch() {
31  chmod -Rf a+rX,u+w,g-w,o-w ${S}
32  #setup -q -n Net-DBus-1.0.0
33  cp ${S}/packaging/perl-Net-DBus.manifest .
34  find . -type f -print0 | xargs -0 chmod 644
35  
36  
37 }
38
39 do_configure() {
40 }
41
42 do_compile() {
43  LANG=C
44  export LANG
45  unset DISPLAY
46  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
47  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
48  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
49  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
50  
51  perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables"
52  make -j16
53  
54  exit 0
55  make test
56  
57  
58  
59 }
60
61 do_install() {
62  echo export RPM_BUILD_ROOT=${D}
63  LANG=C
64  export LANG
65  unset DISPLAY
66  rm -rf ${D} 
67  mkdir -p ${D} 
68  
69  make DESTDIR=$RPM_BUILD_ROOT install_vendor
70  
71    if test -n "$RPM_BUILD_ROOT" -a -d $RPM_BUILD_ROOT/usr/lib/perl/5.14.3//auto; then 
72      find $RPM_BUILD_ROOT/usr/lib/perl/5.14.3//auto -name .packlist -print0 | xargs -0 -r rm 
73      if [ x86_64 == noarch ]; then 
74        find $RPM_BUILD_ROOT/usr/lib/perl/5.14.3//auto -depth -type d -print0 | xargs -0 -r rmdir 
75      fi 
76    fi 
77    rm -f $RPM_BUILD_ROOT/usr/lib/perl/5.14.3//perllocal.pod 
78    
79  
80  FILES=perl-Net-DBus.files
81  # fgen_dir func
82  # IN: dir
83  fgen_dir(){
84  /bin/cat >> $FILES << EOF
85  %dir ${1}
86  EOF
87  }
88  # fgen_file func
89  # IN: file
90  fgen_file(){
91  /bin/cat >> $FILES << EOF
92  ${1}
93  EOF
94  }
95  # check for files in /usr/lib/perl/5.14.3/
96  RES=`find ${RPM_BUILD_ROOT}/usr/lib/perl/5.14.3/ -maxdepth 1 -type f`
97  if [ -n "$RES" ]; then
98    for file in $RES; do
99      fgen_file "/usr/lib/perl/5.14.3//$(basename ${file})"
100    done
101  fi
102  
103  # get all dirs into array
104  base_dir="${RPM_BUILD_ROOT}/usr/lib/perl/5.14.3//"
105  for dir in `find ${base_dir} -type d | sort`; do
106    if [ "$dir" = "${base_dir}" ]; then
107      continue
108    else
109      el=`echo $dir | gawk -F"${base_dir}" '{print $2}'`
110      all_dir=(${all_dir[@]} $el)
111    fi
112  done
113  
114  # build filelist
115  for i in ${all_dir[@]}; do
116    # do not add "dir {perl_vendorlib/arch}/auto", included in perl package
117    if [ "${i}" = "auto" ]; then
118      continue
119    fi
120    if [ "/usr/lib/perl/5.14.3//${i}" = "/usr/lib/perl/5.14.3//auto" ]; then
121      continue
122    else
123      if [ -d ${base_dir}/${i} ]; then
124        RES=`find "${base_dir}/${i}" -maxdepth 1 -type f`
125        if [ -n "$RES" ]; then
126          fgen_dir "/usr/lib/perl/5.14.3//${i}"
127          for file in $RES; do
128            fgen_file "/usr/lib/perl/5.14.3//${i}/$(basename ${file})"
129          done
130        else
131          fgen_dir "/usr/lib/perl/5.14.3//${i}"
132        fi
133      fi
134    fi
135  done
136  # add man pages
137  # if exist :)
138  if [ -d "${RPM_BUILD_ROOT}/usr/share/man" ]; then
139  fgen_file "/usr/share/man/man?/*"
140  fi
141  
142  # add packlist file
143  # generated fom perllocal.pod
144  if [ -f "${RPM_BUILD_ROOT}/var/adm/perl-modules/perl-Net-DBus" ]; then
145    fgen_file "/var/adm/perl-modules/perl-Net-DBus"
146  fi
147  
148  # check for files in /usr/bin
149  if [ -d ${RPM_BUILD_ROOT}/usr/bin ]; then
150    RES=`find "${RPM_BUILD_ROOT}/usr/bin" -maxdepth 1 -type f`
151    if [ -n "$RES" ]; then
152      for file in $RES; do
153        fgen_file "/usr/bin/$(basename ${file})"
154      done
155    fi
156  fi
157  
158  
159 }
160
161 PACKAGES = ""
162 PACKAGES += "perl-Net-DBus"
163
164 perl-Net-DBus_files = ""
165 perl-Net-DBus_files += "perl-Net-DBus.manifest"
166 perl-Net-DBus_files += "AUTHORS CHANGES examples LICENSE Net-DBus.spec README"
167
168 FILES_${PN} = "${perl-Net-DBus_files}"
169
170 PKG_perl-Net-DBus= "perl-Net-DBus"
171
172 require perl-Net-DBus-extraconf.inc