Created
February 18, 2011 17:55
-
-
Save chewmanfoo/834086 to your computer and use it in GitHub Desktop.
spec file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | |
BuildArch: i386 | |
Requires: memcached start-stop-daemon perl-IOT-Spooler | |
Requires: perl-DBD-MySQL perl(Proc::Queue) | |
BuildRequires: libtool libmemcache-devel libxmlparser-devel mysql++-devel | |
BuildRequires: libevent-devel e2fsprogs-devel libxml2-devel libiop_log-devel | |
BuildRequires: ss7dpk-devel libioputils-devel libiopconfig-devel protobuf-devel | |
Source0: %{real_name}-%{version}.tar.gz | |
#Source1: siteconfig.h | |
Source2: ota_binaries.socksrv.init | |
Source3: ota_binaries.socksrv.cfg | |
Source4: ota_binaries-gctload_system.txt | |
Source5: billing_event_spooler.init | |
Source6: reporting_event_spooler.init | |
%description | |
Provides the OTA services. | |
%prep | |
%setup -n %{real_name}-%{version} | |
#cp %{SOURCE1} src/ | |
#sed -i 's|<.*/siteconfig\.h>|"siteconfig\.h"|' src/*.{cpp,h} | |
#sed -i 's|<dialogic\(/.*h\)>|<ss7dpk\1>|' src/*.{cpp,h} | |
sed -i 's|/home/sms|/var/lib/iot|' src/*.* | |
#sed -i 's|./src/gctlib.la||' Makefile.am | |
sed -i '\|/home/sms/logs|d' Makefile.am | |
sed -i '\|/var/otasp/sessions|d' Makefile.am | |
sed -i 's|/etc|%{buildroot}%{_sysconfdir}|' Makefile.am | |
sed -i 's|/usr/local/bin|%{buildroot}%{_bindir}|' Makefile.am | |
sed -i 's|logrotate.d|logrotate.d/ota_binaries|' Makefile.am | |
#sed -i 's|cron.hourly|cron.hourly/ota_binaries|' Makefile.am | |
#sed -i 's|socksrv_LDADD.*|socksrv_LDADD = %{_libdir}/libgctlib.so|' src/Makefile.am | |
#sed -i 's|socksrv_LDADD.*|socksrv_LDADD = -lgctlib|' src/Makefile.am | |
%build | |
./autogen.sh | |
%configure | |
make | |
%install | |
%{__rm} -rf %{buildroot} | |
%{__install} -d -m 0755 %{buildroot}%{_sysconfdir}/{init.d,ota,cron.hourly,logrotate.d} | |
make DESTDIR=%{buildroot} install | |
%{__mkdir_p} %{buildroot}%{_var}/run/socksrv | |
%{__install} -D -m 0755 billing_event_spooler.pl %{buildroot}%{_bindir} | |
%{__install} -D -m 0755 reporting_event_spooler.pl %{buildroot}%{_bindir} | |
%{__install} -D -m 0755 hourly_summaries.sh %{buildroot}%{_bindir} | |
#%{__install} -D -m 0755 otasp_summaries.sh %{buildroot}%{_bindir} | |
%{__install} -D -m 0755 generic_blast.pl %{buildroot}%{_bindir} | |
%{__install} -D -m 0755 generic_lite.pl %{buildroot}%{_bindir} | |
%{__install} -D -m 0755 blast_manager.pl %{buildroot}%{_bindir} | |
%{__install} -D -m 0755 handset_data_bulk_importer.sh %{buildroot}%{_bindir} | |
%{__install} -d -m 0755 %{buildroot}%{_var}/lib/iot/{logs,bin} | |
%{__install} -d -m 0755 %{buildroot}%{_var}/otasp/sessions | |
%{__install} -d -m 0755 %{buildroot}%{_var}/spool/sms/retry | |
%{__mkdir_p} %{buildroot}%{_includedir}/%{name} | |
mv %{buildroot}%{_includedir}/*.* %{buildroot}%{_includedir}/%{name}/ | |
%{__install} -Dm 0755 %{SOURCE3} %{buildroot}%{_sysconfdir}/ota/socksrv.cfg | |
%{__install} -Dm 0755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/socksrv | |
%{__install} -Dm 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/ss7_siu/system.txt-ota_binaries | |
%{__install} -Dm 0755 %{SOURCE5} %{buildroot}%{_sysconfdir}/init.d/billing_event_spooler | |
%{__install} -Dm 0755 %{SOURCE6} %{buildroot}%{_sysconfdir}/init.d/reporting_event_spooler | |
%{__mkdir_p} %{buildroot}%{_usr}/share/%{name}/ | |
%{__install} sql/schema/mysql_{ota,otabill,sms,smpp}.sql %{buildroot}%{_usr}/share/%{name}/ | |
%{__mkdir_p} %{buildroot}%{_usr}/share/%{name}/3.3 | |
%{__install} sql/schema/psql2csv.sh %{buildroot}%{_usr}/share/%{name}/3.3/ | |
%{__install} sql/schema/csv2mysql.pl %{buildroot}%{_usr}/share/%{name}/3.3/ | |
%{__mkdir_p} %{buildroot}%{_usr}/share/%{name}/3.4 | |
%{__install} sql/create_handset_data.sql %{buildroot}%{_usr}/share/%{name}/3.4/ | |
%{__mkdir_p} %{buildroot}%{_usr}/share/%{name}/3.5 | |
%{__install} sql/alter_specific_min_ocn.sql %{buildroot}%{_usr}/share/%{name}/3.5/ | |
%{__install} sql/alter_otapa_blast_details.sql %{buildroot}%{_usr}/share/%{name}/3.5/ | |
%{__install} sql/alter_otasp_events.sql %{buildroot}%{_usr}/share/%{name}/3.5/ | |
%{__install} sql/update_smpp_longer_ocn.sql %{buildroot}%{_usr}/share/%{name}/3.5/ | |
%{__install} sql/otasp_summary_trigger.sql %{buildroot}%{_usr}/share/%{name}/3.5/ | |
%{__install} sql/alter_handset_data.sql %{buildroot}%{_usr}/share/%{name}/3.5/ | |
%{__mkdir_p} %{buildroot}%{_var}/spool/ota/billing/{new,processed,failed,tmp} | |
%{__mkdir_p} %{buildroot}%{_var}/spool/ota/reporting/{new,processed,failed,tmp} | |
%{__mkdir_p} %{buildroot}%{_var}/otasp/sessions/carrier/new | |
%{__mkdir_p} %{buildroot}%{_var}/otasp/session_logs/carrier/new | |
%{__mkdir_p} %{buildroot}/usr/local/bin | |
%{__mkdir_p} %{buildroot}%{_var}/log/ota | |
%{__mkdir_p} %{buildroot}/home/sms | |
ln -s %{_var}/lib/iot %{buildroot}/home/sms | |
ln -s /usr/local/bin %{buildroot}/home/sms | |
ln -s /var/lib/iot/logs %{buildroot}/home/sms/logs | |
ln -s %{_bindir}/ota_prl_push %{buildroot}/%{_bindir}/ota_prl_push_s | |
pushd %{buildroot}/%{_bindir} | |
for FILE in * ; do | |
ln -s %{_bindir}/$FILE %{buildroot}/usr/local/bin/ | |
done | |
popd | |
cat <<EOF >%{buildroot}/etc/cron.hourly/hourly_summary | |
#!/bin/bash | |
/usr/bin/hourly_summaries.sh | |
EOF | |
#cat <<EOF >%{buildroot}/etc/cron.hourly/otasp_summary | |
##!/bin/bash | |
#/usr/bin/otasp_summaries.sh | |
#EOF | |
%clean | |
%{__rm} -rf %{buildroot} | |
%pre | |
# Create system account | |
/usr/sbin/useradd -c "Foo Services" -r -M -s /bin/bash \ | |
-d %{_var}/lib/iot iot &>/dev/null || : | |
%post | |
#/sbin/chkconfig --add socksrv | |
/sbin/chkconfig --add billing_event_spooler | |
/sbin/chkconfig --add reporting_event_spooler | |
%preun | |
if [ $1 -eq 0 ]; then | |
# Last removal, stop service and remove it | |
# /sbin/service socksrv stop &>/dev/null || : | |
/sbin/service billing_event_spooler stop &>/dev/null || : | |
/sbin/service reporting_event_spooler stop &>/dev/null || : | |
# /sbin/chkconfig --del socksrv | |
/sbin/chkconfig --del billing_event_spooler | |
/sbin/chkconfig --del reporting_event_spooler | |
fi | |
%postun | |
if [ $1 -ge 1 ]; then | |
# /sbin/service socksrv condrestart &>/dev/null || : | |
/sbin/service billing_event_spooler condrestart &>/dev/null || : | |
/sbin/service reporting_event_spooler condrestart &>/dev/null || : | |
fi | |
%files | |
%defattr(-, root, root, 0755) | |
%{_bindir}/* | |
%{_sysconfdir}/init.d/* | |
%attr(0755, root, root) %dir %{_sysconfdir}/ota | |
%attr(0755, iot, iot) %dir %{_var}/run/socksrv | |
%attr(0755, iot, iot) %dir %{_var}/lib/iot | |
%attr(0755, iot, iot) %dir %{_var}/lib/iot/* | |
%attr(0755, iot, iot) /home/sms | |
%attr(0755, iot, iot) %{_var}/spool/sms/retry | |
%{_sysconfdir}/sms.cfg.sample | |
%attr(0755, iot, iot) %{_sysconfdir}/cron.hourly/* | |
%{_sysconfdir}/logrotate.d/* | |
%{_sysconfdir}/ota/* | |
%{_sysconfdir}/ss7_siu/* | |
/usr/local/bin | |
%attr(0755, iot, iot) %{_var}/spool/ota | |
%attr(0777, iot, iot) %{_var}/otasp | |
%attr(0755, iot, iot) %dir %{_var}/log/ota | |
%{_usr}/share/%{name}/* | |
%exclude %{_bindir}/test_* | |
%exclude %{_bindir}/decode_buffer | |
%exclude %{_bindir}/encode_buffer | |
%exclude %{_bindir}/esn_hex | |
%exclude %{_bindir}/otapa_start | |
%exclude /usr/local/bin/test_* | |
%exclude /usr/local/bin/decode_buffer | |
%exclude /usr/local/bin/encode_buffer | |
%exclude /usr/local/bin/esn_hex | |
%exclude /usr/local/bin/otapa_start | |
# control center still uses these | |
#%exclude %{_bindir}/ota_prl_push_s | |
#%exclude %{_bindir}/ota_prl_push_2 | |
#%exclude /usr/local/bin/ota_prl_push_s | |
#%exclude /usr/local/bin/ota_prl_push_2 | |
%exclude %{_includedir}/%{name} | |
#%files devel | |
#%defattr(-, root, root, 0644) | |
#%{_includedir}/%{name}/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment