File wallabag.spec of Package wallabag

# spec file for package wallabag
# Copyright (c) Lars Vogdt <>
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           wallabag
Version:        2.1.5
Release:        0
License:        MIT
Summary:        Self hostable application for saving web pages
Group:          Productivity/Networking/Web/Utilities
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}_apache.conf
Source2:        %{name}-rpmlintrc
BuildRequires:  apache2
BuildRequires:  fdupes
Requires:       pcre
Requires:       php-bcmath
Requires:       php-ctype
Requires:       php-curl
Requires:       php-dom
Requires:       php-gd
Requires:       php-gettext
Requires:       php-hash
Requires:       php-iconv
Requires:       php-json
Requires:       php-mbstring
Requires:       php-session
Requires:       php-tidy
Requires:       php-tokenizer
Requires:       php-xmlreader
Requires:       php-zlib
Requires:       php5 >= 5.3.3
Requires:       php_any_db
Requires:       php-pdo
Recommends:     Sphinx >= 1.3.0
Recommends:     guzzle_sphinx_theme >= 0.7.0
Recommends:     php-pgsql
Recommends:     php-composer
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%define         app_dir %{_datadir}/%{name}

wallabag is a self hostable application for saving web pages. Unlike other
services, wallabag is free (as in freedom) and open source.

With this application you will not miss content anymore. Click, save, read it
when you want. It saves the content you select so that you can read it when you
have time.

%setup -q
for file in .composer-auth.json .editorconfig .eslintrc.json .gitignore .scrutinizer.yml .stylelintrc .travis.yml .zappr.yaml; do
	rm $file
rm -rf .github
find . -size 0 -delete
find -name .htaccess -delete
cd scripts
for i in *.sh; do
	BASH=$(which bash)
	sed -i "s|/usr/bin/env.*|$BASH|g" $i
	chmod +x $i
cd ..
find app/Resources -type f -exec chmod -x {} \;

mkdir -p %{buildroot}%{app_dir} \
         %{buildroot}/%{_sysconfdir}/apache2/vhosts.d \

sed -e "s|__APP_DIR__|%{app_dir}|g" %{SOURCE1} > %{buildroot}/%{_sysconfdir}/apache2/vhosts.d/%{name}.conf

mv -v app/config/* %{buildroot}%{_sysconfdir}/%{name}/
rm -rf app/config
cp -r . %{buildroot}%{app_dir}/
cd %{buildroot}%{app_dir}/app
ln -s %{_sysconfdir}/%{name} config
rm %{buildroot}%{app_dir}/*.md
%fdupes -s %{buildroot}%{app_dir} 

%doc *.md
%dir %{app_dir}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*
%config(noreplace) %{_sysconfdir}/apache2/vhosts.d/%{name}.conf