# Generated by go2rpm 1 %bcond_without check # https://github.com/tdewolff/minify %global goipath github.com/tdewolff/minify Version: 2.11.10 %gometa %global goaltipaths github.com/tdewolff/minify/v2 %global common_description %{expand: Minify is a minifier package written in Go. It provides HTML5, CSS3, JS, JSON, SVG and XML minifiers and an interface to implement any other minifier. Minification is the process of removing bytes from a file (such as whitespace) without changing its output and therefore shrinking its size and speeding up transmission over the internet and possibly parsing. The implemented minifiers are designed for high performance. The core functionality associates mimetypes with minification functions, allowing embedded resources (like CSS or JS within HTML files) to be minified as well. Users can add new implementations that are triggered based on a mimetype (or pattern), or redirect to an external command (like ClosureCompiler, UglifyCSS, ...).} %global golicenses LICENSE %global godocs README.md README-minify.md Name: %{goname} Release: %autorelease Summary: Go minifiers for web formats License: MIT URL: %{gourl} Source0: %{gosource} BuildRequires: (golang(github.com/djherbis/atime) >= 1.1.0 with golang(github.com/djherbis/atime) < 2) BuildRequires: (golang(github.com/dustin/go-humanize) >= 1.0.0 with golang(github.com/dustin/go-humanize) < 2) BuildRequires: (golang(github.com/fsnotify/fsnotify) >= 1.5.1 with golang(github.com/fsnotify/fsnotify) < 2) BuildRequires: golang(github.com/matryer/try) BuildRequires: (golang(github.com/spf13/pflag) >= 1.0.5 with golang(github.com/spf13/pflag) < 2) BuildRequires: (golang(github.com/tdewolff/parse/v2) >= 2.5.33 with golang(github.com/tdewolff/parse/v2) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/buffer) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/buffer) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/css) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/css) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/html) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/html) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/js) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/js) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/json) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/json) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/strconv) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/strconv) < 3) BuildRequires: (golang(github.com/tdewolff/parse/v2/xml) >= 2.5.33 with golang(github.com/tdewolff/parse/v2/xml) < 3) %if %{with check} # Tests BuildRequires: (golang(github.com/tdewolff/test) >= 1.0.6 with golang(github.com/tdewolff/test) < 2) %endif %description %{common_description} %gopkg %prep %goprep mv cmd/minify/README.md README-minify.md sed -i \ -e 's|\|gominify|' \ cmd/minify/bash_completion %build export LDFLAGS='-X main.Version=%{version} ' %gobuild -o %{gobuilddir}/bin/gominify %{goipath}/cmd/minify %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # shell completion install -d %{buildroot}%{_datadir}/bash-completion/completions install -Dpm0644 cmd/minify/bash_completion %{buildroot}%{_datadir}/bash-completion/completions/gominify %if %{with check} %check %gocheck %endif %files %license LICENSE %doc README.md README-minify.md %{_bindir}/* %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/gominify %gopkgfiles %changelog %autochangelog