jitsi/jitsi.spec
2020-01-03 01:36:23 +03:00

129 lines
5 KiB
RPMSpec

%global JAVA_HOME /usr/lib/jvm/java-openjdk
%define debug_package %nil
%define label 5623
%define suffix rolling
%define version 2.11
Name: jitsi
Version: %{version}.%{label}
Release: 1
Summary: Jitsi - Open Source Video Calls and Chat
Group: Communications
License: LGPLv2+
URL: https://www.jitsi.org
#Source: http://download.jitsi.org/jitsi/nightly/src/%{name}-src-%{version}.zip
Source0: https://github.com/jitsi/jitsi/archive/%{label}/%{name}-%{label}.tar.gz
Source1: %{name}.desktop
Source2: %{name}.bak
Patch1: %{name}.sh.patch
BuildRoot: %{_topdir}/buildroot
AutoReqProv: no
BuildRequires: java-devel >= 1.8
BuildRequires: ant
BuildRequires: ant-nodeps
BuildRequires: gzip
BuildRequires: subversion
Requires: java
%description
Jitsi is an audio/video Internet phone and instant messenger that
supports some of the most popular instant messaging and telephony protocols
such as SIP, Jabber, AIM/ICQ, MSN, Yahoo! Messenger, Bonjour, RSS and
counting. Jitsi is completely Open Source / Free Software, and is
freely available under the terms of the GNU Lesser General Public License.
%prep
%setup -q -n %{name}-%{label}
#patch1
%build
#JAVA_HOME=/usr/lib/jvm/java-openjdk
ant -Dlabel=%{label} rebuild
%install
# create structure dir
mkdir -p -m 0755 %{buildroot}%{_bindir} \
%{buildroot}%{_datadir}/%{name} \
%{buildroot}%{_datadir}/%{name}/lib \
%{buildroot}%{_datadir}/%{name}/lib/bundle \
%{buildroot}%{_datadir}/%{name}/lib/native \
%{buildroot}%{_datadir}/%{name}/sc-bundles \
%{buildroot}%{_docdir}/%{name} \
%{buildroot}%{_mandir}/man1 \
%{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/pixmaps
# copy the documentation
install -Dm0644 resources/install/debian/jitsi.1.tmpl %{buildroot}%{_mandir}/man1/jitsi.1
sed -i -e "s/_PACKAGE_NAME_/jitsi/" %{buildroot}%{_mandir}/man1/%{name}.1
sed -i -e "s/_APP_NAME_/Jitsi/" %{buildroot}%{_mandir}/man1/%{name}.1
gzip %{buildroot}%{_mandir}/man1/%{name}.1
# copy the launcher script
#install -Dm0655 resources/install/debian/jitsi.sh.tmpl %{buildroot}%{_bindir}/%{name}
#sed -i -e "s/_PACKAGE_NAME_/jitsi/" %{buildroot}%{_bindir}/%{name}
install -Dm655 %{SOURCE2} %{buildroot}%{_bindir}/%{name}
# no more libaoss
#sed -i -e "s@export LD_PRELOAD=/usr/lib/libaoss.so@export LD_PRELOAD=/usr/lib/libaoss.so.0@" $RPM_BUILD_ROOT/usr/bin/sip-communicator
#chmod a+x $RPM_BUILD_ROOT/usr/bin/jitsi
# copy the menu icons
install -Dm0644 resources/install/debian/%{name}-32.xpm %{buildroot}%{_datadir}/pixmaps/%{name}-32.xpm
install -Dm0644 resources/install/debian/%{name}-16.xpm %{buildroot}%{_datadir}/pixmaps/%{name}-16.xpm
install -Dm0644 resources/install/debian/%{name}.svg %{buildroot}%{_datadir}/pixmaps/%{name}.svg
# copy the menu entry
install -Dm0644 resources/install/debian/%{name}.desktop.tmpl %{buildroot}%{_datadir}/applications/%{name}.desktop
sed -i -e "s/_PACKAGE_NAME_/jitsi/" %{buildroot}%{_datadir}/applications/%{name}.desktop
sed -i -e "s/_APP_NAME_/Jitsi/" %{buildroot}%{_datadir}/applications/%{name}.desktop
# copy the sc-bundles
install -Dm0644 sc-bundles/*.jar %{buildroot}%{_datadir}/%{name}/sc-bundles/
# remove all slicks
rm -rf %{buildroot}%{_datadir}/%{name}/sc-bundles/*-slick.jar
rm -rf %{buildroot}%{_datadir}/%{name}/sc-bundles/slick*.jar
# copy the os-specific sc-bundles
install -Dm0644 sc-bundles/os-specific/linux/*.jar %{buildroot}%{_datadir}/%{name}/sc-bundles/
# copy the lib jars
cp lib/*.jar %{buildroot}%{_datadir}/%{name}/lib/
cp lib/bundle/* %{buildroot}%{_datadir}/%{name}/lib/bundle/
rm %{buildroot}%{_datadir}/%{name}/lib/bundle/junit.jar
#cp lib/os-specific/linux/*.jar %{buildroot}%{_datadir}/%{name}/lib/
# copy the native libs
%ifarch i386 i586 i686
install -Dm0644 lib/native/linux/* %{buildroot}%{_datadir}/%{name}/lib/native
%else
install -Dm0644 lib/native/linux-64/* %{buildroot}%{_datadir}/%{name}/lib/native
%endif
# copy the resources
install -Dm0644 resources/install/logging.properties %{buildroot}%{_datadir}/%{name}/lib/
install -Dm0644 lib/felix.client.run.properties %{buildroot}%{_datadir}/%{name}/lib/
# Make felix deploy its bundles in ~/.felix/sip-communicator.bin
sed -i -e "s/felix.cache.profiledir=sip-communicator.bin/felix.cache.profile=sip-communicator.bin/" $RPM_BUILD_ROOT/usr/share/jitsi/lib/felix.client.run.properties
# fix shell script
sed -i -e "s/\/usr\/lib\/jni/\$LIBPATH\/native/" $RPM_BUILD_ROOT/usr/bin/jitsi
sed -i -e "s/\/usr\/share\/java\/jdic\.jar/\$LIBPATH\/jdic_stub\.jar:\$LIBPATH\/jdic-all\.jar/" $RPM_BUILD_ROOT/usr/bin/jitsi
sed -i -e "s/\/usr\/share\/java\/org\.apache\.felix\.framework\.jar/\$LIBPATH\/felix\.jar/" $RPM_BUILD_ROOT/usr/bin/jitsi
sed -i -e "s/\/usr\/share\/java\/org\.apache\.felix\.main\.jar://" $RPM_BUILD_ROOT/usr/bin/jitsi
sed -i -e "s/\/launchutils.jar//" $RPM_BUILD_ROOT/usr/bin/jitsi
%clean
%files
%defattr(-,root,root,-)
%doc %{_mandir}/man*/*
%{_bindir}/%{name}
#{_libdir}/%{name}/*.so
%{_datadir}/%{name}
%{_datadir}/applications/%{name}*
%{_datadir}/pixmaps/%{name}*
%changelog