]>
Commit | Line | Data |
---|---|---|
ab4223ae ER |
1 | # |
2 | # Conditional build: | |
d6faab77 JB |
3 | %bcond_without static_libs # static library |
4 | %bcond_without tests # check target | |
d5afc843 | 5 | %bcond_with tests_valgrind # use valgrind for tests (suspectible to glibc false positives) |
ab4223ae ER |
6 | |
7 | %ifnarch %{ix86} %{x8664} | |
d6faab77 | 8 | # valgrind required |
ab4223ae ER |
9 | %undefine with_tests |
10 | %endif | |
11 | ||
12 | Summary: Command-line JSON processor | |
d6faab77 | 13 | Summary(pl.UTF-8): Procesor JSON działający z linii poleceń |
ab4223ae ER |
14 | Name: jq |
15 | Version: 1.5 | |
4ddf780c | 16 | Release: 5 |
d6faab77 | 17 | License: MIT, Apache, CC-BY, GPL v3 |
97271e8a | 18 | Group: Applications/Text |
d6faab77 | 19 | #Source0Download: https://github.com/stedolan/jq/releases |
ab4223ae ER |
20 | Source0: https://github.com/stedolan/jq/releases/download/%{name}-%{version}/jq-%{version}.tar.gz |
21 | # Source0-md5: 0933532b086bd8b6a41c1b162b1731f9 | |
97271e8a | 22 | Patch0: static.patch |
ab4223ae | 23 | URL: https://stedolan.github.io/jq/ |
d6faab77 JB |
24 | BuildRequires: autoconf >= 2.64 |
25 | BuildRequires: automake >= 1:1.11.2 | |
26 | BuildRequires: bison >= 3 | |
ab4223ae | 27 | BuildRequires: flex |
d6faab77 | 28 | BuildRequires: libtool >= 2:2 |
ab4223ae | 29 | BuildRequires: oniguruma-devel |
d5afc843 | 30 | %if %{with tests_valgrind} |
ab4223ae ER |
31 | BuildRequires: valgrind |
32 | %endif | |
33 | Requires: %{name}-libs = %{version}-%{release} | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
d6faab77 | 37 | lightweight and flexible command-line JSON processor. |
ab4223ae ER |
38 | |
39 | jq is like sed for JSON data - you can use it to slice and filter and | |
40 | map and transform structured data with the same ease that sed, awk, | |
41 | grep and friends let you play with text. | |
42 | ||
43 | It is written in portable C, and it has zero runtime dependencies. | |
44 | ||
d6faab77 JB |
45 | %description -l pl.UTF-8 |
46 | Lekki i elastyczny procesor JSON działający z linii poleceń. | |
47 | ||
48 | jq jest odpowiednikiem seda dla danych JSON - można go używać do | |
49 | podziału, filtrowania, odwzorowywania i przekształceń danych | |
50 | strukturalnych tak samo łatwo, jak programy sed, awk, grep i podobne | |
51 | pozwalają bawić się tekstem. | |
52 | ||
53 | Jest napisany w przenośnym C i nie ma dodatkowych zależności. | |
ab4223ae ER |
54 | |
55 | %package libs | |
d6faab77 JB |
56 | Summary: Shared jq library |
57 | Summary(pl.UTF-8): Biblioteka współdzielona jq | |
ab4223ae ER |
58 | Group: Libraries |
59 | ||
60 | %description libs | |
d6faab77 JB |
61 | Shared jq library. |
62 | ||
63 | %description libs -l pl.UTF-8 | |
64 | Biblioteka współdzielona jq. | |
ab4223ae ER |
65 | |
66 | %package devel | |
d6faab77 JB |
67 | Summary: Header files for jq library |
68 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki jq | |
69 | Group: Development/Libraries | |
ab4223ae ER |
70 | Requires: %{name}-libs = %{version}-%{release} |
71 | ||
72 | %description devel | |
d6faab77 JB |
73 | Header files for jq library. |
74 | ||
75 | %description devel -l pl.UTF-8 | |
76 | Pliki nagłówkowe biblioteki jq. | |
77 | ||
78 | %package static | |
79 | Summary: Static jq library | |
80 | Summary(pl.UTF-8): Statyczna biblioteka jq | |
81 | Group: Development/Libraries | |
82 | Requires: %{name}-devel = %{version}-%{release} | |
83 | ||
84 | %description static | |
85 | Static jq library. | |
86 | ||
87 | %description static -l pl.UTF-8 | |
88 | Statyczna biblioteka jq. | |
ab4223ae ER |
89 | |
90 | %prep | |
97271e8a ER |
91 | %setup -q |
92 | %patch0 -p1 | |
ab4223ae ER |
93 | |
94 | %build | |
97271e8a | 95 | %{__libtoolize} |
dcd7543b | 96 | %{__aclocal} -I config/m4 |
97271e8a ER |
97 | %{__autoconf} |
98 | %{__automake} | |
ab4223ae | 99 | %configure \ |
125477e6 | 100 | --disable-docs \ |
d6faab77 | 101 | %{!?with_static_libs:--disable-static} \ |
97271e8a | 102 | --disable-all-static \ |
d5afc843 JB |
103 | --disable-silent-rules \ |
104 | %{!?with_tests_valgrind:--disable-valgrind} | |
ab4223ae | 105 | |
26df1630 AO |
106 | echo -e '#!/bin/sh\necho "'%{version}'"' > scripts/version |
107 | ||
ab4223ae ER |
108 | %{__make} |
109 | ||
110 | # Docs already shipped in jq's tarball. | |
111 | # In order to build the manual page, it | |
d5afc843 | 112 | # is necessary to install rake, rubygem-ronn, bonsai |
ab4223ae ER |
113 | # and do the following steps: |
114 | # | |
115 | # # yum install rake rubygem-ronn | |
116 | # $ cd docs/ | |
117 | # $ curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3 | |
118 | # $ source $HOME/.rvm/scripts/rvm | |
119 | # $ bundle install | |
120 | # $ cd .. | |
121 | # $ ./configure | |
122 | # $ make real_docs | |
123 | ||
124 | %if %{with tests} | |
125 | %{__make} check | |
126 | %endif | |
127 | ||
128 | %install | |
129 | rm -rf $RPM_BUILD_ROOT | |
130 | %{__make} install \ | |
131 | DESTDIR=$RPM_BUILD_ROOT | |
132 | ||
133 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} | |
134 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libjq.la | |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %post libs -p /sbin/ldconfig | |
140 | %postun libs -p /sbin/ldconfig | |
141 | ||
142 | %files | |
143 | %defattr(644,root,root,755) | |
144 | %doc README README.md AUTHORS COPYING | |
145 | %attr(755,root,root) %{_bindir}/jq | |
146 | %{_mandir}/man1/jq.1* | |
147 | ||
148 | %files libs | |
149 | %defattr(644,root,root,755) | |
150 | %attr(755,root,root) %{_libdir}/libjq.so.*.*.* | |
d6faab77 | 151 | %attr(755,root,root) %ghost %{_libdir}/libjq.so.1 |
ab4223ae ER |
152 | |
153 | %files devel | |
154 | %defattr(644,root,root,755) | |
d6faab77 | 155 | %attr(755,root,root) %{_libdir}/libjq.so |
ab4223ae ER |
156 | %{_includedir}/jq.h |
157 | %{_includedir}/jv.h | |
d6faab77 JB |
158 | |
159 | %if %{with static_libs} | |
160 | %files static | |
161 | %defattr(644,root,root,755) | |
162 | %{_libdir}/libjq.a | |
163 | %endif |