[Bug 1590921] Review Request: restic - restic is a backup program that is fast, efficient and secure.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1590921

Robert-André Mauchin <zebob.m@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zebob.m@xxxxxxxxx



--- Comment #2 from Robert-André Mauchin <zebob.m@xxxxxxxxx> ---
 - Take a look at https://fedoraproject.org/wiki/More_Go_packaging to package
Go apps

 - You need to unbundle vendor/ first, which implies packaging several
libraries. Use gofed to help you (install and use the version from
updates-testing if you're on F27).

 -Shouldn't be necessary:

%define debug_package %{nil}

 - Don't do that:

#Gzip man pages
/usr/bin/gzip %{_builddir}/%{name}-%{version}/doc/man/*

  Compressing man pages is handled by the packaging process

 - Don't put .gz as the compression can change in the future:

%{_mandir}/man1/restic*.*

 - Don't mark man pages as doc

 - Own the directories you create with %dir:

%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_restic
%dir %{_datadir}/bash-completion/
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/rest

 - Don't install doc that way, just use %doc directly with the files:

%files devel -f devel.file-list
%license LICENSE
%doc GOVERNANCE.md CONTRIBUTING.md CHANGELOG.md README.rst 

 - Don't install from %{_builddir}/%{name}-%{version}/ : when you are in %build
or %install, you are in the folder where the archive has been extracted, so you
have access directly to the files you wanna install.


Here's a sample I've created based on the Gofed output. I have not tested it.


# https://github.com/restic/restic
%global goipath         github.com/restic/restic
Version:                0.9.1

%gometa

Name:           restic
Release:        1%{?dist}
Summary:        Fast, secure, efficient backup program
License:        BSD
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires: golang(bazil.org/fuse)
BuildRequires: golang(bazil.org/fuse/fs)
BuildRequires: golang(github.com/Azure/azure-sdk-for-go/storage)
BuildRequires: golang(github.com/cenkalti/backoff)
BuildRequires: golang(github.com/elithrar/simple-scrypt)
BuildRequires: golang(github.com/google/go-cmp/cmp)
BuildRequires: golang(github.com/juju/ratelimit)
BuildRequires: golang(github.com/kurin/blazer/b2)
BuildRequires: golang(github.com/mattn/go-isatty)
BuildRequires: golang(github.com/minio/minio-go)
BuildRequires: golang(github.com/minio/minio-go/pkg/credentials)
BuildRequires: golang(github.com/ncw/swift)
BuildRequires: golang(github.com/pkg/errors)
BuildRequires: golang(github.com/pkg/sftp)
BuildRequires: golang(github.com/pkg/xattr)
BuildRequires: golang(github.com/restic/chunker)
BuildRequires: golang(golang.org/x/crypto/poly1305)
BuildRequires: golang(golang.org/x/crypto/scrypt)
BuildRequires: golang(golang.org/x/crypto/ssh/terminal)
BuildRequires: golang(golang.org/x/net/context)
BuildRequires: golang(golang.org/x/net/context/ctxhttp)
BuildRequires: golang(golang.org/x/net/http2)
BuildRequires: golang(golang.org/x/oauth2/google)
BuildRequires: golang(golang.org/x/sync/errgroup)
BuildRequires: golang(golang.org/x/sys/unix)
BuildRequires: golang(golang.org/x/text/encoding/unicode)
BuildRequires: golang(google.golang.org/api/googleapi)
BuildRequires: golang(google.golang.org/api/storage/v1)
BuildRequires: golang(gopkg.in/tomb.v2)

%description
%{summary}


%prep
%gosetup -q

%build 
%gobuildroot
%gobuild -o _bin/%{name} %{goipath}


%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_datarootdir}/zsh/site-functions
mkdir -p %{buildroot}%{_datarootdir}/bash-completion/completions
install -p -m 755 _bin/%{name} %{buildroot}%{_bindir}
install -p -m 644 doc/man/* %{buildroot}%{_mandir}/man1/
#zsh completion
install -p -m 644 doc/zsh-completion.zsh
%{buildroot}%{_datarootdir}/zsh/site-functions/_restic
#Bash completion
install -p -m 644 doc/bash-completion.sh
%{buildroot}%{_datarootdir}/bash-completion/completions/restic


%check
%gochecks


%files devel -f devel.file-list
%license LICENSE
%doc GOVERNANCE.md CONTRIBUTING.md CHANGELOG.md README.rst
%{_bindir}/%{name}
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_restic
%dir %{_datadir}/bash-completion/
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/restic
%{_mandir}/man1/restic*.*

%changelog
* Wed Jun 13 2018 Steve Miller <copart@xxxxxxxxx> - 0.9.1-1
- First package for Fedora



 - You can look at: https://eclipseo.fedorapeople.org/golang/ for more examples
if you need help packaging the dependencies.
  Search on https://src.fedoraproject.org/ to see what dependencies are already
packaged and which one are missing.
  I suggest trying to build all deps within your COPR and see if restic builds
then. 


Don't hesitate to contact me for help on my email.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx/message/NLXN6N2WETPLN2IOIGVW53QCVDBGBX6O/




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux