]> git.pld-linux.org Git - SPECS.git/blob - pacparser.spec
SPECS updated Sun 1 Aug 20:28:02 CEST 2021
[SPECS.git] / pacparser.spec
1 #
2 # Conditional build:
3 %bcond_without  python  # Python module
4 #
5 Summary:        A library to make your web software pac (proxy auto-config) files intelligent
6 Summary(pl.UTF-8):      Biblioteka do obsługi plików pac (automatycznej konfiguracji proxy)
7 Name:           pacparser
8 Version:        1.3.1
9 Release:        1
10 License:        LGPL v3+
11 Group:          Libraries
12 Source0:        http://pacparser.googlecode.com/files/%{name}-%{version}.tar.gz
13 # Source0-md5:  97010ef3c18f81f8734e3cc3d6f92619
14 #Source0Download: http://code.google.com/p/pacparser/downloads/list
15 Patch0:         %{name}-make.patch
16 Patch1:         %{name}-libdir.patch
17 Patch2:         %{name}-python.patch
18 URL:            http://code.google.com/p/pacparser/
19 BuildRequires:  js-devel >= 1.7.0
20 BuildRequires:  js-devel < 1.8.5
21 BuildRequires:  rpmbuild(macros) >= 1.566
22 BuildRequires:  sed >= 4.0
23 %if %{with python}
24 BuildRequires:  python-devel
25 BuildRequires:  rpm-pythonprov
26 %endif
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 pacparser is a library to parse proxy auto-config (PAC) files. Proxy
31 auto-config files are a vastly used proxy configuration method these
32 days. Web browsers can use a PAC file to determine which proxy server
33 to use or whether to go direct for a given URL. PAC files are written
34 in JavaScript and can be programmed to return different proxy methods
35 (e.g. "PROXY proxy1:port; DIRECT") depending upon URL, source IP
36 address, protocol, time of the day etc. PAC files introduce a lot of
37 possibilities.
38
39 Needless to say, PAC files are now a widely accepted method for proxy
40 configuration management and companies all over are using them in
41 corporate environment. Almost all popular web browsers support PAC
42 files. The idea behind pacparser is to make it easy to add this PAC
43 file parsing capability to any program (C and Python supported right
44 now). Some very useful targets could be popular web software like
45 wget, curl and python-urllib.
46
47 %description -l pl.UTF-8
48 pacparser to biblioteka do analizy plików automatycznej konfiguracji
49 proxy PAC (proxy auto-config). Pliki te są obecnie szeroko stosowaną
50 metodą do konfiguracji proxy. Przeglądarki potrafią użyć pliku PAC do
51 określenia, którego serwera proxy mają użyć lub jak połączyć się
52 bezpośrednio z danym URL-em. Pliki PAC są pisane w JavaScripcie i mogą
53 zwracać różne metody proxy (np. "PROXY proxy1:port; DIRECT") w
54 zależności od URL-a, adresu źródłowego IP, protokołu, pory dnia itp.
55 Pliki PAC wprowadzają wiele możliwości.
56
57 Nie trzeba mówić, że pliki PAC są teraz szeroko akceptowaną metodą
58 zarządzania konfiguracją proxy, a firmy używają ich w swoich
59 wewnętrznych środowiskach. Prawie wszystkie popularne przeglądarki WWW
60 obsługują pliki PAC. Ideą stojącą za biblioteką pacparser jest
61 ułatwienie dodawania obsługi PAC do dowolnego programu (obecnie
62 obsługiwane są języki C i Python). Przydatnymi zastosowaniami mogłyby
63 być popularne programy do stron WWW, takie jak wget, curl czy
64 python-urllib.
65
66 %package devel
67 Summary:        Header files for pacparser library
68 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki pacparser
69 Group:          Development/Libraries
70 Requires:       %{name} = %{version}-%{release}
71
72 %description devel
73 Header files for pacparser library.
74
75 %description devel -l pl.UTF-8
76 Pliki nagłówkowe biblioteki pacparser.
77
78 %package -n python-pacparser
79 Summary:        Python interface for pacparser library
80 Summary(pl.UTF-8):      Interfejs Pythona do biblioteki pacparser
81 Group:          Libraries/Python
82 Requires:       %{name} = %{version}-%{release}
83 %pyrequires_eq  python-libs
84
85 %description -n python-pacparser
86 Python interface for pacparser library.
87
88 %description -n python-pacparser -l pl.UTF-8
89 Interfejs Pythona do biblioteki pacparser.
90
91 %prep
92 %setup -q
93 %patch0 -p1
94 %patch1 -p1
95 %undos src/pymod/setup.py
96 %patch2 -p1
97
98 %build
99 %{__make} -C src \
100         CC="%{__cc}" \
101         CFLAGS="%{rpmcflags} -I/usr/include/js -DXP_UNIX" \
102         LDFLAGS="%{rpmldflags} -ljs" \
103         LIB=%{_lib}
104
105 %if %{with python}
106 cd src/pymod
107 CFLAGS="%{rpmcflags}" \
108 LDFLAGS="%{rpmldflags} -L$(pwd)/.." \
109 %{__python} setup.py build
110 %endif
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114
115 %{__make} -C src install \
116         DESTDIR=$RPM_BUILD_ROOT \
117         LIB=%{_lib}
118
119 %if %{with python}
120 cd src/pymod
121 %{__python} setup.py install \
122         --optimize=2 \
123         --root=$RPM_BUILD_ROOT
124
125 %py_postclean
126 %endif
127
128 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %post   -p /sbin/ldconfig
134 %postun -p /sbin/ldconfig
135
136 %files
137 %defattr(644,root,root,755)
138 %doc README
139 %attr(755,root,root) %{_bindir}/pactester
140 %attr(755,root,root) %{_libdir}/libpacparser.so.1
141 %{_mandir}/man1/pactester.1*
142
143 %files devel
144 %defattr(644,root,root,755)
145 %attr(755,root,root) %{_libdir}/libpacparser.so
146 %{_includedir}/pacparser.h
147 %{_mandir}/man3/pacparser*.3*
148
149 %if %{with python}
150 %files -n python-pacparser
151 %defattr(644,root,root,755)
152 %dir %{py_sitedir}/pacparser
153 %attr(755,root,root) %{py_sitedir}/pacparser/_pacparser.so
154 %{py_sitedir}/pacparser/__init__.py[co]
155 %{py_sitedir}/pacparser-1-py*.egg-info
156 %endif
This page took 1.737731 seconds and 3 git commands to generate.