Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1476589 (deepin-api) - Review Request: deepin-api - Go-lang bingding for dde-daemon
Summary: Review Request: deepin-api - Go-lang bingding for dde-daemon
Keywords:
Status: CLOSED RAWHIDE
Alias: deepin-api
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: golang-github-BurntSushi-xgb 1480962 golang-github-alecthomas-kingpin
Blocks: DeepinDEPackageReview startdde deepin-daemon
TreeView+ depends on / blocked
 
Reported: 2017-07-30 14:25 UTC by sensor.wen
Modified: 2018-07-22 13:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-22 13:30:00 UTC
Type: Bug
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Description sensor.wen 2017-07-30 14:25:23 UTC
SPEC: https://raw.githubusercontent.com/FZUG/repo/master/rpms/deepin_project/deepin-api.spec

Description: Go-lang bingding for dde-daemon

Fedora Account System Username: mosquito

Comment 3 Ye Cheng 2017-08-08 06:50:30 UTC
(In reply to sensor.wen from comment #2)
> SPEC: 
> https://copr-be.cloud.fedoraproject.org/results/mosquito/deepin/fedora-26-
> x86_64/00586135-deepin-api/deepin-api.spec

>go get github.com/disintegration/imaging \
>    github.com/howeyc/fsnotify \
>    gopkg.in/check.v1 \
>    gopkg.in/alecthomas/kingpin.v2
This will fail the mock build because network access is not available at build time and these downloaded library become undesirably bundled into the application.
Reference:http://fedoraproject.org/wiki/Packaging:Guidelines#Build_time_network_access

It seems that github.com/howeyc/fsnotify is no longer actively maintained. Please switch to golang-github-go-fsnotify-fsnotify package if possible.

>%{_datadir}/icons/hicolor/*/actions/*
If it is necessary for these icon to display properly immediately after installation, please write a %post script let to refresh icon cache. Please reference https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Icon_Cache for detail

>%{_unitdir}/*.service
Perhaps some  %post,%preun and %postun script lets are necessary for handling systemd units. Please reference
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd

Comment 4 sensor.wen 2017-08-08 11:29:31 UTC
Diff:  https://github.com/FZUG/repo/commit/beffb7e08c0dd0cb99167dd24a544a33932cb070

> This will fail the mock build because network access is not available at build time and these downloaded library become undesirably bundled into the application.
Reference:http://fedoraproject.org/wiki/Packaging:Guidelines#Build_time_network_access
Fixed

> It seems that github.com/howeyc/fsnotify is no longer actively maintained. Please switch to golang-github-go-fsnotify-fsnotify package if possible.
The golang-github-go-fsnotify-fsnotify is not work with deepin-api.

> If it is necessary for these icon to display properly immediately after installation, please write a %post script let to refresh icon cache. Please reference https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Icon_Cache for detail
Fixed

> Perhaps some  %post,%preun and %postun script lets are necessary for handling systemd units. Please reference
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
Fixed

Comment 6 Ye Cheng 2017-08-09 13:58:52 UTC
Please submit the review requests of the following packages(and add them on        depends on field), so the package won't have broken dependencies when merged.
  golang-github-disintegration-imaging-devel
  golang-github-alecthomas-kingpin-devel
  golang-github-BurntSushi-xgbutil-devel
  golang-github-BurntSushi-xgb-devel
  golang-deepin-go-lib-devel
  deepin-go-dbus-factory

Please use BuildRequires: pkgconfig(gtk+-3.0) instead of BuildRequires:  gtk3-devel for all the libraries located using pkg-config, because the dependency won't break when the name of the package providing the library was changed when coded this way.
> Makefile:12
> LDFLAGS = $(shell pkg-config --libs gio-2.0 gtk+-3.0 gdk-pixbuf-xlib-2.0 x11 xi >xfixes xcursor libcanberra cairo-ft poppler-glib librsvg-2.0)
>BuildRequires:  gtk3-devel 
...
Please refer to https://fedoraproject.org/wiki/Packaging:PkgConfigBuildRequires for detail.

Please avoid hard-coded path if possile
>%make_install SYSTEMD_LIB_DIR="/usr/lib" LIBDIR="/libexec"
A better way is to use SYSTEMD_SERVICE_DIR ="%{_unitdir}" instead of SYSTEMD_LIB_DIR="/usr/lib" as it is supported in Makefile. 
I don't know whether it is acceptable to code LIBDIR="/libexec" as LIBDIR="%{_libexecdir}"

The pakage dose not honor the applicable compiler flags 
>Makefile:13
>GOBUILD = go build -compiler gccgo -gccgoflags "${LDFLAGS}"
export GOBUILD=$(%gobuild | sed 's|${LDFLAGS:-}|${LDFLAGS}|') could be a quick fix if it can be built with gc, compile using gccgo may require some tweaks on flags.
%gobuild evaluates to rpm --eval %gobuild :
%ifnarch ppc64 
go build -buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'" -a -v -x ;
%else 
go build -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'" -a -v -x ;
%endif


This package should conform Go packaging guideline:https://fedoraproject.org/wiki/PackagingDrafts/Go.Thus, ExclusiveArch:  %{go_arches} should be added; a better way to write build requires: gcc-go and golang-deepin-go-lib-devel  is  compiler(gcc-go) and golang(github.com/linuxdeepin/go-lib), etc ...

Comment 8 Robert-André Mauchin 🐧 2017-08-23 14:36:15 UTC
Could you please redo this package with gofed as a starting point?

Comment 10 Robert-André Mauchin 🐧 2017-08-25 08:54:06 UTC
 - I think you need to change:

BuildRequires:  deepin-go-dbus-factory

   to:

BuildRequires:  golang-deepin-dbus-factory-devel


 - The license should be :

License:        GPLv3+

 - Replace make with %make_build

 - You forgot the systemd BR:

%{?systemd_requires}
BuildRequires:  systemd

 - I don't understand why you are using:

BuildArch:      noarch
ExclusiveArch:  %{go_arches} noarch

for %package -n golang-%{name}-devel. It shouldn't be a noarch package.

  Shouldn't you be using the typical Golang ExclusivArch:

ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}



Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed



===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "GPL (v3 or later)", "Unknown or generated". 76 files have
     unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/deepin-api/review-deepin-
     api/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/share/gocode/src/pkg.deepin.io,
     /usr/share/gocode/src/pkg.deepin.io/dde
[x]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/share/gocode/src,
     /usr/share/gocode/src/pkg.deepin.io/dde, /usr/share/gocode,
     /usr/share/gocode/src/pkg.deepin.io
[x]: Package does not own files or directories owned by other packages.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: gtk-update-icon-cache is invoked in %postun and %posttrans if package
     contains icons.
     Note: icons in deepin-api
[x]: Useful -debuginfo package or justification otherwise.
[-]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[!]: Uses parallel make %{?_smp_mflags} macro.
[x]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in golang-
     deepin-api-devel , deepin-api-debuginfo
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: deepin-api-3.1.11-2.fc26.x86_64.rpm
          golang-deepin-api-devel-3.1.11-2.fc26.noarch.rpm
          deepin-api-debuginfo-3.1.11-2.fc26.x86_64.rpm
          deepin-api-3.1.11-2.fc26.src.rpm
deepin-api.x86_64: W: spelling-error Summary(en_US) lang -> Lang, lag, slang
deepin-api.x86_64: W: spelling-error Summary(en_US) bingding -> binding, wingding, bidding
deepin-api.x86_64: W: spelling-error Summary(en_US) dde -> dd, dded, dude
deepin-api.x86_64: W: spelling-error %description -l en_US lang -> Lang, lag, slang
deepin-api.x86_64: W: spelling-error %description -l en_US bingding -> binding, wingding, bidding
deepin-api.x86_64: W: spelling-error %description -l en_US dde -> dd, dded, dude
golang-deepin-api-devel.noarch: W: spelling-error Summary(en_US) lang -> Lang, lag, slang
golang-deepin-api-devel.noarch: W: spelling-error Summary(en_US) bingding -> binding, wingding, bidding
golang-deepin-api-devel.noarch: W: spelling-error %description -l en_US lang -> Lang, lag, slang
golang-deepin-api-devel.noarch: W: spelling-error %description -l en_US bingding -> binding, wingding, bidding
golang-deepin-api-devel.noarch: W: spelling-error %description -l en_US io -> oi, Io, ii
golang-deepin-api-devel.noarch: W: no-documentation
deepin-api.src: W: spelling-error Summary(en_US) lang -> Lang, lag, slang
deepin-api.src: W: spelling-error Summary(en_US) bingding -> binding, wingding, bidding
deepin-api.src: W: spelling-error Summary(en_US) dde -> dd, dded, dude
deepin-api.src: W: spelling-error %description -l en_US lang -> Lang, lag, slang
deepin-api.src: W: spelling-error %description -l en_US bingding -> binding, wingding, bidding
deepin-api.src: W: spelling-error %description -l en_US dde -> dd, dded, dude
4 packages and 0 specfiles checked; 0 errors, 18 warnings.

Comment 12 Robert-André Mauchin 🐧 2017-08-26 14:38:28 UTC
It looks good, package accepted.

Comment 13 Robert-André Mauchin 🐧 2017-08-27 15:44:10 UTC
@mosquito: There an issue, could you add:


Provides:       golang(%{import_path}) = %{version}-%{release}

to this package, otherwise package depending on golang(pkg.deepin.io/dde/api) can't find it.

Comment 14 sensor.wen 2017-08-27 15:51:52 UTC
Don't worry, i added the follows content to build requires.

> golang(pkg.deepin.io/dde/api/dxinput)

Comment 15 Gwyn Ciesla 2017-08-28 12:43:33 UTC
(fedrepo-req-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/deepin-api

Comment 16 Zamir SUN 2018-07-22 13:30:00 UTC
This is already in Rawhide. Closing on behalf of the Deepin Desktop packaging effort.


Note You need to log in before you can comment on or make changes to this bug.