Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 82e3334c74b3d383e8c26a2aba9e4c6f > files > 3

ajenti-1.2.22-11.mga5.src.rpm

%define name ajenti
%define version 1.2.22
%define unmangled_version 1.2.22
%define release 11
%global with_python3 0

Summary: The server administration panel
Name: %{name}
Version: %{version}
Release: %mkrel %{release}
Source0: %{name}-%{version}.tar.gz
# This contains fixes for sslwrap
Source1: https://raw.githubusercontent.com/Eugeny/ajenti/54442ccb2b9ee24af15500557e7dd7b2f58acb97/ajenti/compat.py
Patch0: ajenti-mageia.patch

License: AGPLv3
Group: System/Configuration
BuildArch: noarch
Url: http://ajenti.org/
BuildRequires: coffee-script
BuildRequires: nodejs-less
BuildRequires: openssl

BuildRequires: python-gevent
BuildRequires: python-greenlet
BuildRequires: python-lxml

BuildRequires: python-gevent-socketio
BuildRequires: python-gevent-websocket
BuildRequires: python-psutil >= 0.6.0
BuildRequires: python-imaging
BuildRequires: python-daemon
BuildRequires: python-passlib
BuildRequires: python-requests
BuildRequires: python-reconfigure >= 0.1.46
BuildRequires: python-catcher
BuildRequires: python-exconsole >= 0.1.5

%if %{?with_python3}
BuildRequires: python3-gevent
BuildRequires: python3-greenlet
BuildRequires: python3-lxml

BuildRequires: python3-gevent-socketio
BuildRequires: python3-gevent-websocket
BuildRequires: python3-psutil >= 0.6.0
BuildRequires: python3-imaging
BuildRequires: python3-daemon
BuildRequires: python3-passlib
BuildRequires: python3-requests
BuildRequires: python3-reconfigure >= 0.1.46
BuildRequires: python3-catcher
BuildRequires: python3-exconsole >= 0.1.5
%endif

# mageia dbus package does not have egg file
Requires: python-dbus
Requires: python-daemon
Requires: python-catcher
Requires: python-reconfigure


%description
Web admin panel

%if 0%{?with_python3}
%package -n ajenti-python3
Summary: The server administration panel
%description -n ajenti-python3
Web admin panel.

Python3 version is missing LDAP due to python-ldap not having been ported.
%endif

%prep
%setup -q -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version}
sed -e 's/dbus-python//' -i requirements.txt
%apply_patches
cp %{SOURCE1} ajenti/compat.py
rm -rf %{pypi_name}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
2to3 -n -w %{py3dir}
pushd %{py3dir}
2to3 -n -w ajenti-*
rm ajenti/usersync/ldapsync.py
rm ajenti/usersync/adsync.py
sed -i -e 's!python-ldap!!' requirements.txt
sed -i -e 's!from .ldapsync import LDAPSyncProvider!!' \
    -e 's!from .adsync import ActiveDirectorySyncProvider!!' \
    ajenti/usersync/__init__.py
popd
%endif # with_python3

%build
make
%if 0%{?with_python3}
pushd %{py3dir}
make
popd
%endif # with_python3

%install
%if 0%{?with_python3}
pushd %{py3dir}
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --prefix=/usr
install -p -D -m 0644 packaging/files/ajenti.service %{buildroot}%{_unitdir}/ajenti-python3.service
pushd %{buildroot}/%{_bindir}
mv ajenti-panel ajenti-panel-python3
mv ajenti-ipc ajenti-ipc-python3
mv ajenti-ssl-gen ajenti-ssl-gen-python3
popd
%endif
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --prefix=/usr
install -p -D -m 0644 packaging/files/ajenti.service %{buildroot}%{_unitdir}/ajenti.service
rm %{buildroot}/etc/init.d/ajenti
rm %{buildroot}%{_localstatedir}/lib/ajenti/plugins/.placeholder

%files 
%config(noreplace) /etc/ajenti/config.json
%{_unitdir}/ajenti.service
%{_localstatedir}/lib/ajenti/plugins
%{_bindir}/ajenti-panel
%{_bindir}/ajenti-ipc
%{_bindir}/ajenti-ssl-gen
%{python_sitelib}/ajenti
%{python_sitelib}/ajenti-*-py?.?.egg-info
%if 0%{?with_python3}
%files  -n %{name}-python3
%config(noreplace) /etc/ajenti/config.json
%{_unitdir}/ajenti-python3.service
%{_localstatedir}/lib/ajenti/plugins
%{_bindir}/ajenti-panel-python3
%{_bindir}/ajenti-ipc-python3
%{_bindir}/ajenti-ssl-gen-python3
%{python3_sitelib}/ajenti
%{python3_sitelib}/ajenti-*-py?.?.egg-info
%endif

%post
ajenti-ssl-gen `hostname`
%_post_service %{name}

echo ------------------------------------------------
echo Ajenti will listen on HTTPS port 8000 by default
echo
echo Default username : root
echo Default password : admin
echo ------------------------------------------------

%preun
%_preun_service %{name}

%if 0%{?with_python3}
%post -n %{name}-python3
ajenti-ssl-gen-python3 `hostname`
%_post_service %{name}-python3

echo ------------------------------------------------
echo Ajenti will listen on HTTPS port 8000 by default
echo
echo Default username : root
echo Default password : admin
echo ------------------------------------------------

%preun -n %{name}-python3
%_preun_service %{name}-python3
%endif


%changelog
* Fri Apr 03 2015 joequant <joequant> 1.2.22-11.mga5
+ Revision: 819652
- fix sslwrap issue for bug #15584

* Sun Oct 26 2014 joequant <joequant> 1.2.22-10.mga5
+ Revision: 793385
- add requires that aren't auto-required

  + umeabot <umeabot>
    - Second Mageia 5 Mass Rebuild

  + tv <tv>
    - rebuild for missing pythoneggs deps

* Tue Sep 16 2014 umeabot <umeabot> 1.2.22-7.mga5
+ Revision: 677727
- Mageia 5 Mass Rebuild

* Mon Aug 11 2014 joequant <joequant> 1.2.22-6.mga5
+ Revision: 661780
- add mageia ipv6 firewall support

* Mon Aug 11 2014 joequant <joequant> 1.2.22-5.mga5
+ Revision: 661775
- add mageia patches

* Wed Aug 06 2014 joequant <joequant> 1.2.22-4.mga5
+ Revision: 660228
- clean up spec

* Mon Aug 04 2014 joequant <joequant> 1.2.22-3.mga5
+ Revision: 659536
- compile css files

* Sun Aug 03 2014 joequant <joequant> 1.2.22-2.mga5
+ Revision: 659487
- fix python-dbus dependency

* Sun Aug 03 2014 joequant <joequant> 1.2.22-1.mga5
+ Revision: 659330
- add ajenti

* Wed Jul 23 2014 joequant <joequant> 1.2.21-1.mga5
+ Revision: 655928
- fix spec errors
- add coffee-scripts and nodejs-less
- imported package ajenti