summaryrefslogtreecommitdiff
path: root/palemoon/palemoon.spec
blob: 9135eadd768ad5608865be5d7161bb859bdf78fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
%global tarballdir UXP-PM%{version}_Release
%global dummy_package   0
%global pkgname palemoon
%global prettyname Pale Moon Web Browser

# additional repos to get python27 and devtoolset-7
# for el6 and el7: Software Collection;, for x86_64 only
# http://mirror.centos.org/centos/6/sclo/x86_64/rh/
# http://mirror.centos.org/centos/6/sclo/x86_64/sclo/
# for el6.i386:
# https://copr-be.cloud.fedoraproject.org/results/ewdurbin/pythons-el6/epel-6-$basearch/
# https://copr-be.cloud.fedoraproject.org/results/mlampe/devtoolset-7/epel-6-$basearch/
%define scl_env %{nil}
%define scl_buildreq coreutils
%if 0%{?el6}
   %define scl_buildreq python27, devtoolset-7-toolchain
   %ifarch x86_64
      %define scl_env python27 devtoolset-7
   %endif
   %ifarch i386 || i686 || i586
      %define scl_env devtoolset-7
   %endif
%endif
%if 0%{?el7}
   %define scl_env devtoolset-7
   %define scl_buildreq devtoolset-7-toolchain
%endif

Name:		palemoon
Version:	28.2.0
Release:	1
Summary:	Pale Moon web browser

Group:	Networking/Web
License:	MPLv2.0
URL:		http://linux.palemoon.org/
Source0:	https://github.com/MoonchildProductions/UXP/archive/PM%{version}_Release.tar.gz
Source1: palemoon-mozconfig
Source2: palemoon.desktop
Source3: palemoon-mimeinfo.xml
Packager:	Bgstack15 <bgstack15@gmail.com>

%if "%{?scl_env}" != ""
BuildRequires: %{scl_buildreq}
%endif
BuildRequires:	alsa-lib-devel
BuildRequires:	autoconf213
BuildRequires:	bzip2-devel
BuildRequires:	dbus-glib-devel
BuildRequires:	desktop-file-utils
BuildRequires:	gcc
BuildRequires:	gcc-c++
BuildRequires:	GConf2-devel
BuildRequires:	glib2-devel
BuildRequires:	gtk2-devel
BuildRequires:	libXt-devel
BuildRequires:	mesa-libGL-devel
BuildRequires:	notification-daemon
BuildRequires:	openssl-devel
BuildRequires:	pkgconfig
BuildRequires:	pkgconfig(gtk+-2.0)
BuildRequires:	pulseaudio-libs-devel
BuildRequires:	sqlite-devel
BuildRequires:	unzip
BuildRequires:	yasm
BuildRequires:	zip
BuildRequires:	zlib-devel
BuildRoot:     %{_tmppath}/%{name}-%{version}
Provides:      mimehandler(application/x-xpinstall)
Provides:      webclient

%description
Pale Moon offers you a browsing experience in a browser completely built
from its own, independently developed source that has been forked off from
Firefox/Mozilla code, with carefully selected features and optimizations to
improve the browser's speed*, resource use, stability and user experience,
while offering full customization and a growing collection of extensions
and themes to make the browser truly your own.

%global debug_package %{nil}
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

%prep
%setup -q -n %{tarballdir}
%{__cp} %{SOURCE1} ./.mozconfig

%build
# when version < 28.0.0 it needed gcc 4.9
#source /usr/bin/gcc49
%if "%{?scl_env}" != ""
   thispwd=$( pwd )
   scl enable %{scl_env} /bin/bash << EOF
   pushd $thispwd
%endif
%if !%{dummy_package}
   ./mach build
%endif
%if "%{?scl_env}" != ""
   popd || :
EOF
%endif

%install
rm -rf %{buildroot}

%if "%{?scl_env}" != ""
   thispwd=$( pwd )
   scl enable %{scl_env} /bin/bash << EOF
   pushd $thispwd
%endif
%if !%{dummy_package}
   make -f client.mk \
      DESTDIR=%{buildroot} \
      idldir=%{_datadir}/idl/%{name} \
      includedir=%{_includedir}/%{name} \
      installdir=%{_libdir}/%{name} \
      sdkdir=%{_libdir}/%{name}-devel \
      install
%endif
%if "%{?scl_env}" != ""
   popd || :
EOF
%endif

# cleanup
%{__rm} -rf  %{buildroot}%{_datadir}/idl/%{pkgname} \
   %{buildroot}%{_includedir}/%{pkgname} \
   %{buildroot}%{_libdir}/%{pkgname}-devel

# desktop files
%{__mkdir_p} %{buildroot}%{_datadir}/applications
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE2}

%{__sed} -i -r -e "s/@NAME@/%{prettyname}/;" \
   -e "s/@EXEC@/%{pkgname}/;" \
   -e "s/@ICON@/%{pkgname}/;" \
   %{buildroot}%{_datadir}/applications/%{pkgname}.desktop

# application start script
# none

# man pages
# none

# mimetypes
%{__install} -Dm0644 %{SOURCE3} \
   %{buildroot}%{_datadir}/mime/packages/%{pkgname}.xml

# icons
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
for s in 16 22 24 32 48 256 ;
do
   %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps
   %{__cp} -p application/%{pkgname}/branding/official/default${s}.png \
   %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/%{pkgname}.png
done

# Register as an application to be visible in the software center
# EXPERIMENTAL
mkdir -p %{buildroot}%{_datadir}/appdata
cat > %{buildroot}%{_datadir}/appdata/%{pkgname}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Adapted from content by Richard Hughes <richard-at-hughsie-dot-com> -->
<application>
  <id type="desktop">%{pkgname}.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <description>
    <p>
       Pale Moon offers you a browsing experience in a browser completely built from its own, independently developed source that has been forked off from Firefox/Mozilla code a number of years ago, with carefully selected features and optimizations to improve the browser stability and user experience, while offering full customization and a growing collection of extensions and themes to make the browser truly your own.
    </p>
  </description>
  <url type="homepage">http://www.palemoon.org/</url>
  <screenshots>
    <screenshot type="default">http://www.palemoon.org/images/screenshots/Win10-start-portal.png</screenshot>
  </screenshots>
  <!-- FIXME: change this to an upstream email address for spec updates
  <updatecontact>someone_who_cares@upstream_project.org</updatecontact>
   -->
</application>
EOF

# Add distribution.ini
# skipped

# filelist lifted straight from https://build.opensuse.org/package/view_file/network/palemoon/palemoon.spec?expand=1
# get a list of files
# $2 - dirlist
# $3 - dir of fileslist
# $4 - excludelist
filelist() {
  filelist=$PWD/$1
  pushd %{buildroot}
    find ./ | while read list; do
      if [ -n "$4" ]; then
        ! echo $list | grep "$4" || continue
      fi
      _file=$(echo $list | sed 's/[^/]//')
      _dir=$(dirname $_file)
      if echo $_dir | grep "$2"; then
        grep -xqs "\%dir\ $_dir" $filelist || echo "%dir $_dir" >> $filelist
      fi
      if echo $_file | grep "$3"; then
        [ -d "$list" ] || echo $_file >> $filelist
      fi
    done
  popd
}

filelist file.lst %{pkgname} usr langpack

%clean
%{__rm} -rf %{buildroot} || :

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-desktop-database &> /dev/null || :

%preun
# is it a final removal?
#if test "$1" = "0" ;
#then
#fi   

%postun
update-desktop-database &> /dev/null || :
if test "$1" = "0" ;
then
   touch --no-create %{_datadir}/icons/hicolor &>/dev/null
   gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files -f file.lst
%defattr(-,root,root)
%doc AUTHORS LICENSE

%changelog
* Thu Sep 20 2018 B Stack <bgstack15@gmail.com> 28.1.0-1
- update version

* Thu Sep 13 2018 B Stack <bgstack15@gmail.com> 28.0.1-1
- update version

* Wed Sep 05 2018 B Stack <bgstack15@gmail.com> 28.0.0-1
- rpm spec updated
bgstack15