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