Snippets
Created by
Atri Bhattacharya
last modified
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 | priority -49
extends sh
snippet %def "%define" b
%define ${1:variable} ${2:value}
endsnippet
snippet %files "File list under %files" b
%files -n ${1:pkg}
%license ${2:COPYING}
%{${3:_prefix}}/${4}
endsnippet
snippet %if "%if %endif" b
%if ${1:condition}
$2
%endif
endsnippet
snippet %ifel "%if %endif" b
%if ${1:condition}
$2
%else
$3
%endif
endsnippet
snippet %ifw "%if %{with var}" b
%if %{with ${1:var}}
$2
%endif
endsnippet
snippet %ifwel "%if %{with var}" b
%if %{with ${1:var}}
$2
%else
$3
%endif
endsnippet
snippet %ifarch "%ifarch %endif" b
%ifarch ${1:arch}
$2
%endif
endsnippet
snippet %ifnarch "%ifnarch %endif" b
%ifnarch ${1:arch}
$2
endsnippet
snippet brq "BuildRequires" b
BuildRequires: ${1:${VISUAL}}
endsnippet
snippet brqif "BuildRequires" b
BuildRequires: (${1:} if ${2} ${3:>=} ${4})
endsnippet
snippet brqcmake "BuildRequires: pkgconfig(foo)" b
BuildRequires: cmake(${1:${VISUAL}})
endsnippet
snippet brqpkg "BuildRequires: pkgconfig(foo)" b
BuildRequires: pkgconfig(${1:${VISUAL}})
endsnippet
snippet rec "Recommends:" b
Recommends: ${1:${VISUAL}}
endsnippet
snippet rq "Requires:" b
Requires: ${1:${VISUAL}}
endsnippet
snippet rqif "Requires: (A if B)" b
Requires: (${1:pkgA} if ${2:pkgB})
endsnippet
snippet rqor "Requires: (A or B)" b
Requires: (${1:pkgA} or ${2:pkgB})
endsnippet
snippet rqpost "Requires(post):" b
Requires(post): ${1:${VISUAL}}
Requires(postun): $1
endsnippet
snippet supp "Supplements: (A and B)" b
Supplements: (${1:pkgA} and ${2:pkgB})
endsnippet
snippet pkg "Package" b
%package ${1:name}
Summary: ${2:Package summary (80 characters)}
%description $1
${3:Package description.}
%files $1
%license ${4:COPYING}
%doc ${5:README.md}
%{${6:_prefix}}/${7}
endsnippet
snippet pkgn "Package" b
%package -n ${1:name}
Summary: ${2:Package summary (80 characters)}
%description -n $1
${3:Package description.}
%files -n $1
%license ${4:COPYING}
%doc ${5:README.md}
%{${6:_prefix}}/${7}
endsnippet
snippet ldpost "ldconfig post(un) scriptlets"
%post ${1:name} -p ${2:/sbin/ldconfig}
%postun $1 -p $2
endsnippet
snippet shlibdev "Shared library package" b
%package -n lib${1:name}${2:<so_version>}
Summary: ${3:Package summary (80 characters)}
%description -n lib$1$2
${4:Package description.}
%package -n $1-devel
Summary: ${5:Package summary (80 characters)}
Requires: lib$1$2 = %{version}
%description -n $1-devel
${6:Package description.}
%post -n lib$1$2 -p /sbin/ldconfig
%postun -n lib$1$2 -p /sbin/ldconfig
%files -n lib$1$2
%license ${7:COPYING}
%{_libdir}/lib$1.so.$2*
%files -n $1-devel
%license $7
%{_libdir}/lib$1.so
%{_includedir}/$8
endsnippet
# vim: ft=snippets ts=2 sw=2 et:
|
Comments (0)
You can clone a snippet to your computer for local editing. Learn more.