Bug 1024136 - Review Request: gedit-template - Gedit plugin to create new files from templates
Review Request: gedit-template - Gedit plugin to create new files from templates
Status: NEW
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nobody's working on this, feel free to take it
Fedora Extras Quality Assurance
:
Depends On:
Blocks: FE-DEADREVIEW
  Show dependency treegraph
 
Reported: 2013-10-28 19:50 EDT by Germán Racca
Modified: 2015-12-20 08:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
New spec. (1.54 KB, text/x-rpm-spec)
2013-10-30 08:05 EDT, Mosaab Alzoubi
no flags Details

  None (edit)
Description Germán Racca 2013-10-28 19:50:49 EDT
Spec URL: http://skytux.fedorapeople.org/packages/gedit-template.spec

SRPM URL: http://skytux.fedorapeople.org/packages/gedit-template-0.0.2-1.fc19.src.rpm

Description:
This plugin for Gedit allows creation of new documents from templates.

By default this plugin looks for templates in ~/Templates. You can change this
by editing the source.

Fedora Account System Username: skytux

Koji builds from scratch:
F-19: http://koji.fedoraproject.org/koji/taskinfo?taskID=6109707
F-20: http://koji.fedoraproject.org/koji/taskinfo?taskID=6109717
Rawhide: http://koji.fedoraproject.org/koji/taskinfo?taskID=6109732

$ rpmlint {SPECS,SRPMS,RPMS/x86_64}/gedit-template*
gedit-template.x86_64: E: no-binary
gedit-template.x86_64: W: only-non-binary-in-usr-lib
2 packages and 1 specfiles checked; 1 errors, 1 warnings.

(rpmlint complaints can be ignored because gedit plugins must be arched)
Comment 1 Germán Racca 2013-10-28 20:28:50 EDT
Please discard previous koji builds and refer only to the following ones:

F-19: http://koji.fedoraproject.org/koji/taskinfo?taskID=6109806
F-20: http://koji.fedoraproject.org/koji/taskinfo?taskID=6109818
Rawhide: http://koji.fedoraproject.org/koji/taskinfo?taskID=6109825

Thanks,
Germán.
Comment 2 Mosaab Alzoubi 2013-10-30 06:44:49 EDT
> (rpmlint complaints can be ignored because gedit plugins must be arched)

Why ??

- Lib dir variable as arch.
Comment 3 Germán Racca 2013-10-30 07:39:54 EDT
(In reply to Mosaab Alzoubi from comment #2)
> > (rpmlint complaints can be ignored because gedit plugins must be arched)
> 
> Why ??
> 
> - Lib dir variable as arch.

I based my spec file in this review:

https://bugzilla.redhat.com/show_bug.cgi?id=965007
Comment 4 Mosaab Alzoubi 2013-10-30 08:05:23 EDT
Created attachment 817445 [details]
New spec.

- Tweaked to be noarch.
Comment 5 Germán Racca 2013-10-30 12:43:23 EDT
Mosaab Alzoubi,

If people agree that it shoudn't be arched, then I don't have any problems in changing the spec file to be noarch. But please, have you taken a look at the link of the review of a similar package?
Comment 6 Michael Schwendt 2013-10-30 14:38:36 EDT
> # Tweak to be noarch
> %global geditlib %{_libdir}/gedit/plugins

That would be wrong for targets where %_libdir is not /usr/lib.

gedit's directory for arch-independent plugins is: %{_datadir}/gedit/plugins

See ./gedit/gedit-plugins-engine.c and ./gedit/gedit-dirs.c in the gedit source code.
Comment 7 Michael Schwendt 2013-10-30 14:40:56 EDT
You can also examine the "gedit-plugins" package, which uses both plugin dirs.
Comment 8 Germán Racca 2013-10-30 15:57:35 EDT
(In reply to Michael Schwendt from comment #6)
> > # Tweak to be noarch
> > %global geditlib %{_libdir}/gedit/plugins
> 
> That would be wrong for targets where %_libdir is not /usr/lib.
> 
> gedit's directory for arch-independent plugins is: %{_datadir}/gedit/plugins
> 
> See ./gedit/gedit-plugins-engine.c and ./gedit/gedit-dirs.c in the gedit
> source code.

Thanks very much for your comments Michael.

So, do you suggest to install this noarch plugin in %{_datadir}/gedit/plugins?

I'm not sure if it will work, but I'm going to test it.

BTW, why you didn't suggest to use that path for noarch plugins in the review of gedit-trailsave? I proposed to use that path in the second comment and somebody said I was "horrible wrong"!
Comment 9 Michael Schwendt 2013-10-30 17:02:59 EDT
Sorry, I've misread the gedit source code. There is just %_libdir/gedit/plugins for all plugins and an additional data dir for plugin data files:

…
	gedit_plugins_dir = g_build_filename (gedit_lib_dir,
					      "plugins",
					      NULL);
	gedit_plugins_data_dir = g_build_filename (gedit_data_dir,
						   "plugins",
						   NULL);
…
	peas_engine_add_search_path (PEAS_ENGINE (engine),
	                             gedit_dirs_get_user_plugins_dir (),
	                             gedit_dirs_get_user_plugins_dir ());

	peas_engine_add_search_path (PEAS_ENGINE (engine),
	                             gedit_dirs_get_gedit_plugins_dir (),
	                             gedit_dirs_get_gedit_plugins_data_dir ());
…

https://developer.gnome.org/libpeas/0.9/PeasEngine.html#peas-engine-add-search-path
Comment 10 Michael Schwendt 2013-10-30 17:05:29 EDT
As a side-note, I'm just a sporadic user of gedit. Currently, I don't even find its Preferences.

> ... the review of gedit-trailsave?

I've not done an own review, but only visited the spec changes.
Comment 11 Germán Racca 2013-10-30 17:15:43 EDT
(In reply to Michael Schwendt from comment #9)
> Sorry, I've misread the gedit source code. There is just
> %_libdir/gedit/plugins for all plugins and an additional data dir for plugin
> data files:
> 
> …
> 	gedit_plugins_dir = g_build_filename (gedit_lib_dir,
> 					      "plugins",
> 					      NULL);
> 	gedit_plugins_data_dir = g_build_filename (gedit_data_dir,
> 						   "plugins",
> 						   NULL);
> …
> 	peas_engine_add_search_path (PEAS_ENGINE (engine),
> 	                             gedit_dirs_get_user_plugins_dir (),
> 	                             gedit_dirs_get_user_plugins_dir ());
> 
> 	peas_engine_add_search_path (PEAS_ENGINE (engine),
> 	                             gedit_dirs_get_gedit_plugins_dir (),
> 	                             gedit_dirs_get_gedit_plugins_data_dir ());
> …
> 
> https://developer.gnome.org/libpeas/0.9/PeasEngine.html#peas-engine-add-
> search-path

Indeed, I have tryed installing the plugin in %{_datadir} but it doesn't work.
Comment 12 Germán Racca 2013-10-30 17:18:03 EDT
(In reply to Michael Schwendt from comment #10)
> As a side-note, I'm just a sporadic user of gedit. Currently, I don't even
> find its Preferences.
> 
> > ... the review of gedit-trailsave?
> 
> I've not done an own review, but only visited the spec changes.

Look at the top bar of the Shell, where the Gedit icon is. Click on it and a drop-down menu will pop up.
Comment 13 Michael Schwendt 2013-10-30 17:34:21 EDT
Uh! =:-O

Thanks!
Comment 14 Mosaab Alzoubi 2013-10-31 06:07:34 EDT
Yes I read old bug, and I see that's better for this package to be noarch, because it's really arch-independ.
Comment 15 Michael Schwendt 2013-10-31 06:52:57 EDT
It cannot be noarch. See comment 9. Again, sorry for the confusion my previous comment in this ticket may have caused.
Comment 16 Mosaab Alzoubi 2013-10-31 07:28:27 EDT
Yes Michael , See tweaked spec from attachment.
Comment 17 Michael Schwendt 2013-10-31 08:42:28 EDT
> BuildArch: noarch

That doesn't work.

Assume the "noarch" package were built on an x86_64 build server:

  $ arch
  x86_64
  $ rpm -E %_libdir
  /usr/lib64

The plugin installed to a directory below /usr/lib64 would not be visible to gedit.i686 expecting plugins to be stored below /usr/lib. And vice versa.
Comment 18 Mosaab Alzoubi 2013-10-31 14:56:36 EDT
You right :)

This package under revision now ...
Comment 19 Mosaab Alzoubi 2013-10-31 17:18:14 EDT
- There is a rpmlint note that arched package doesn't have any binary file, so that reated to gedit plugin folder which contain (lib).
- I reviewed this package and it has no error , I think It will approved.

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

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.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses found:
     "Unknown or generated". 1 files have unknown license. Detailed output of
     licensecheck in /home/moceap/IM/1024136-gedit-template/licensecheck.txt
[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.
[-]: 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.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 2 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]: 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 %doc.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[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]: Each %files section contains %defattr if rpm < 4.4
[x]: Macros in Summary, %description expandable at SRPM build time.
[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 do not use a name that already exist
[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

Python:
[x]: Python eggs must not download any dependencies during the build process.
[-]: A package which is used by another package via an egg interface should
     provide egg info.
[x]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: Binary eggs must be removed in %prep

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

Generic:
[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]: Package functions as described.
[x]: Latest version is packaged.
[-]: 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.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[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]: Dist tag is present (not strictly required in GL).
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: SourceX tarball generation or download is documented.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

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

Generic:
[x]: Rpmlint is run on all installed packages.
[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: gedit-template-0.0.2-1.fc19.i686.rpm
          gedit-template-0.0.2-1.fc19.src.rpm
gedit-template.i686: E: no-binary
gedit-template.i686: W: only-non-binary-in-usr-lib
2 packages and 0 specfiles checked; 1 errors, 1 warnings.




Requires
--------
gedit-template (rpmlib, GLIBC filtered):
    gedit(x86-32)



Provides
--------
gedit-template:
    gedit-template
    gedit-template(x86-32)



Source checksums
----------------
https://github.com/dzysyak/Templates-plugin-for-GEdit3/archive/854a562c6ad098a0b3fb699177cd95f74d93e885/gedit-template-0.0.2-854a562.tar.gz :
  CHECKSUM(SHA256) this package     : fdc0e4eeab8cd0f94f6b6d4818b92dc679816790fc96ddd98145a823f518757a
  CHECKSUM(SHA256) upstream package : fdc0e4eeab8cd0f94f6b6d4818b92dc679816790fc96ddd98145a823f518757a
Comment 20 Germán Racca 2013-10-31 22:47:47 EDT
Thanks for the review Mosaab. Is it informal? If you are packager, you can assign it to you and approve it if you think so.
Comment 21 Mosaab Alzoubi 2013-11-01 07:56:47 EDT
Yes it is, I'm not a packager I'll be soon :)

Your package Will be APROVED.
Comment 22 Germán Racca 2013-11-01 11:42:31 EDT
(In reply to Mosaab Alzoubi from comment #21)
> Yes it is, I'm not a packager I'll be soon :)
> 
> Your package Will be APROVED.

Will be? That's funny hehe...

OK, good luck with the packaging! :)
Comment 23 Christopher Meng 2013-11-01 23:10:17 EDT
Please give me a latest SPEC/SRPM URL.(Do not give me Koji links.)

Thanks.
Comment 24 Germán Racca 2013-11-01 23:43:32 EDT
(In reply to Christopher Meng from comment #23)
> Please give me a latest SPEC/SRPM URL.(Do not give me Koji links.)
> 
> Thanks.

Christopher,

Koji builds are necessary to show that the package compiled successfully. Also, if anyone else want to test the package, koji links provide packages ready to install.

I don't understand what do you mean by latest. Spec file and source rpm file were not modified. Please, read carefully all the comments to know what has happened in this bug.

Thanks,
Germán.
Comment 25 Michael Schwendt 2013-11-02 06:18:47 EDT
An up-to-date pair of "Spec URL:" and "SRPM URL:" lines in the review ticket makes it convenient to run "fedora-review -b 1024136", *and* it becomes obvious where to find the latest package among a growing number of comments in the ticket.

I can only encourage package submitters to post fresh Spec/SRPM URLs and to increase the Release tag with every update of the package. The latter is already mentioned at: https://fedoraproject.org/wiki/Packaging:FrequentlyMadeMistakes
Comment 26 Germán Racca 2013-11-02 07:15:41 EDT
(In reply to Michael Schwendt from comment #25)
> An up-to-date pair of "Spec URL:" and "SRPM URL:" lines in the review ticket
> makes it convenient to run "fedora-review -b 1024136", *and* it becomes
> obvious where to find the latest package among a growing number of comments
> in the ticket.
> 
> I can only encourage package submitters to post fresh Spec/SRPM URLs and to
> increase the Release tag with every update of the package. The latter is
> already mentioned at:
> https://fedoraproject.org/wiki/Packaging:FrequentlyMadeMistakes

I don't get it. What are the changes I have to make to the spec file? There was nothing to change, we agreed that the package has to be arched... or am I missing something? Please tell me if I do.
Comment 27 Michael Schwendt 2013-11-02 08:02:13 EDT
It's only a misunderstanding. If there hasn't been an update, the original Spec/SRPM links are still valid. After plenty of comments in the ticket, that's not so obvious anymore, so reposting them doesn't hurt (albeit is not mandatory).

[...]

In the %description:

> By default this plugin looks for templates in ~/Templates.
> You can change this by editing the source.

The second sentence is misleading. The installed plugin _is_ a source file, since it's written in Python. However, editing is not really an option for RPM package users, because the next update would overwrite the changes.

The plugin could evaluate XDG_TEMPLATES_DIR.


> # python3 is pulled from gedit dependencies, so no need to install
> explicitly
> Requires:       gedit%{?_isa}

Only one of gedit's current plugins depends on Python 3. Gedit itself does not. Optimising dependencies is frowned upon. _This_ particular plugin requires Python 3, so there ought to be a dependency.


> $ rpmls -p gedit-template-0.0.2-1.fc19.x86_64.rpm 
> -rw-r--r--  /usr/lib64/gedit/plugins/template.plugin
> -rw-r--r--  /usr/lib64/gedit/plugins/template.py
> drwxr-xr-x  /usr/share/doc/gedit-template-0.0.2
> -rw-r--r--  /usr/share/doc/gedit-template-0.0.2/LICENSE
> -rw-r--r--  /usr/share/doc/gedit-template-0.0.2/README

http://fedoraproject.org/wiki/Packaging:Python#Byte_compiling
Comment 28 Germán Racca 2013-11-02 15:03:32 EDT
(In reply to Michael Schwendt from comment #27)
> It's only a misunderstanding. If there hasn't been an update, the original
> Spec/SRPM links are still valid. After plenty of comments in the ticket,
> that's not so obvious anymore, so reposting them doesn't hurt (albeit is not
> mandatory).

Sorry for the misunderstanding, now I get it. I will update the spec file as soon as I can implement your suggestions.


> [...]
> 
> In the %description:
> 
> > By default this plugin looks for templates in ~/Templates.
> > You can change this by editing the source.
> 
> The second sentence is misleading. The installed plugin _is_ a source file,
> since it's written in Python. However, editing is not really an option for
> RPM package users, because the next update would overwrite the changes.
> 
> The plugin could evaluate XDG_TEMPLATES_DIR.
> 

To avoid any mistake, I think it's better to remove that last sentence (I will suggest upstream the possibility to evaluate XDG_TEMPLATES_DIR).


> > # python3 is pulled from gedit dependencies, so no need to install
> > explicitly
> > Requires:       gedit%{?_isa}
> 
> Only one of gedit's current plugins depends on Python 3. Gedit itself does
> not. Optimising dependencies is frowned upon. _This_ particular plugin
> requires Python 3, so there ought to be a dependency.

Not sure if I understand very well here. My logic is: Gedit requires Python 3 (because 'rpm -q --requires gedit' says 'python(abi) = 3.3'), and this plugin requires Gedit.


> > $ rpmls -p gedit-template-0.0.2-1.fc19.x86_64.rpm 
> > -rw-r--r--  /usr/lib64/gedit/plugins/template.plugin
> > -rw-r--r--  /usr/lib64/gedit/plugins/template.py
> > drwxr-xr-x  /usr/share/doc/gedit-template-0.0.2
> > -rw-r--r--  /usr/share/doc/gedit-template-0.0.2/LICENSE
> > -rw-r--r--  /usr/share/doc/gedit-template-0.0.2/README
> 
> http://fedoraproject.org/wiki/Packaging:Python#Byte_compiling

Byte compiled files are present in my system:

 rpmls -p gedit-template-0.0.2-1.fc19.x86_64.rpm
-rw-r--r--  /usr/lib64/gedit/plugins/template.plugin
-rw-r--r--  /usr/lib64/gedit/plugins/template.py
-rw-r--r--  /usr/lib64/gedit/plugins/template.pyc
-rw-r--r--  /usr/lib64/gedit/plugins/template.pyo
drwxr-xr-x  /usr/share/doc/gedit-template-0.0.2
-rw-r--r--  /usr/share/doc/gedit-template-0.0.2/LICENSE
-rw-r--r--  /usr/share/doc/gedit-template-0.0.2/README

Why is that?


Thanks for your comments!
Comment 29 Michael Schwendt 2013-11-02 15:46:47 EDT
> My logic is: Gedit requires Python 3 (because 'rpm -q --requires gedit'
> says 'python(abi) = 3.3'), and this plugin requires Gedit.

This is okay, because _currently_ it works. Currently, package gedit contains an explicit dependency on Python 3. But generally, you cannot guarantee that such a dependency won't move to a different package (and actually, moved dependencies have lead to run-time breakage before). gedit-template directly needs Python 3, so that should be added as a package dependency.


> Byte compiled files are present in my system:

That looks as if they have been bytecompiled for Python 2. The Python 3 based __pycache__ dir is missing.


> Why is that?

Try adding to the spec:

%global __python %{__python3}
Comment 30 Germán Racca 2013-11-02 16:46:29 EDT
(In reply to Michael Schwendt from comment #29)
> > My logic is: Gedit requires Python 3 (because 'rpm -q --requires gedit'
> > says 'python(abi) = 3.3'), and this plugin requires Gedit.
> 
> This is okay, because _currently_ it works. Currently, package gedit
> contains an explicit dependency on Python 3. But generally, you cannot
> guarantee that such a dependency won't move to a different package (and
> actually, moved dependencies have lead to run-time breakage before).
> gedit-template directly needs Python 3, so that should be added as a package
> dependency.

Thanks for sharing your experience on packaging!


> > Byte compiled files are present in my system:
> 
> That looks as if they have been bytecompiled for Python 2. The Python 3
> based __pycache__ dir is missing.

You are right. I looked at the content of the package gedit-plugins, and it has the __pycache__ directory. 


> > Why is that?
> 
> Try adding to the spec:
> 
> %global __python %{__python3}

That did the trick. It created the __pycache__ dir with the corresponding files inside it:

$ rpmls RPMS/x86_64/gedit-template-0.0.2-2.fc19.x86_64.rpm 
drwxr-xr-x  /usr/lib64/gedit/plugins/__pycache__
-rw-r--r--  /usr/lib64/gedit/plugins/__pycache__/template.cpython-33.pyc
-rw-r--r--  /usr/lib64/gedit/plugins/__pycache__/template.cpython-33.pyo
-rw-r--r--  /usr/lib64/gedit/plugins/template.plugin
-rw-r--r--  /usr/lib64/gedit/plugins/template.py
drwxr-xr-x  /usr/share/doc/gedit-template-0.0.2
-rw-r--r--  /usr/share/doc/gedit-template-0.0.2/LICENSE
-rw-r--r--  /usr/share/doc/gedit-template-0.0.2/README


Please find updated files here:

Spec URL: http://skytux.fedorapeople.org/packages/gedit-template.spec

SRPM URL: http://skytux.fedorapeople.org/packages/gedit-template-0.0.2-2.fc19.src.rpm

Koji build from scratch for F19: http://koji.fedoraproject.org/koji/taskinfo?taskID=6130529

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