Tendrl / ui

A repository for the front-end artifacts of Tendrl UI
GNU Lesser General Public License v2.1
6 stars 20 forks source link

build is not automated via rpm specfile #141

Closed mbukatov closed 7 years ago

mbukatov commented 7 years ago

Current status

Instructions in current rpm specfile expects that the source tarball (specified via Source0: %{name}-%{version}.tar.gz) contains the build of dashboard already.

To perform this build, one needs manually follow information in README file (installing npm, gulp, ... configuration and build itself).

Latest COPR build of tendrl-dashboard doesn't do the build either: the srpm file pushed into COPR contains "source" tarball with the build and spec file from this repository, with a minor change:

$ diff tendrl-dashboard.spec tendrl-dashboard.git.spec 
3c3
< Release: 02_20_2017_19_24_15
---
> Release: 1%{?dist}

Description of the problem

The most important problem with the current state are:

This also means that (just listing few obvious consequences here):

Expected status

The specfile contains:

This way, the whole build process is done via rpmbuild.

Note: for this to work, you would need to create a mock environment which will have required javascript dev tools available.

mbukatov commented 7 years ago

@dahorak @mkudlej (fyi)

sankarshanmukhopadhyay commented 7 years ago

@TimothyAsir please explore the path to resolve this once you are back from PTO

sankarshanmukhopadhyay commented 7 years ago

Is this on-going or, are we done? If yes, can we close it with a comment?

mbukatov commented 7 years ago

Is this on-going or, are we done? If yes, can we close it with a comment?

This is on going.

nthomas-redhat commented 7 years ago

This is already taken care. @mbukatov please close this issue

sankarshanmukhopadhyay commented 7 years ago

If this can be verified as complete, please provide update on this.

nthomas-redhat commented 7 years ago

@mbukatov , do you agree with what is implemented? I am planning to close this issue

mbukatov commented 7 years ago

The change looks good, thank you for fixing this, it will make the maintenance much easier!

I was trying to rebuild the package step by step myself to check the process. First I need to get source tarballs and I decided to generate them based on current source from git repo:

[makerpm@telesto projects]$ git clone https://github.com/Tendrl/dashboard.git tendrl-dashboard
[makerpm@telesto projects]$ cd tendrl-dashboard
[makerpm@telesto tendrl-dashboard]$ make build-pkgs-dist
[makerpm@telesto tendrl-dashboard]$ make dist

At this point, I have both source tarballs listed in the spec file:

$ ls -lh tendrl-*tar.gz
-rw-rw-r--. 1 makerpm makerpm 220K May 25 15:59 tendrl-dashboard-1.3.0.tar.gz
-rw-rw-r--. 1 makerpm makerpm  91M May 25 15:57 tendrl-dashboard-build-pkgs.tar.gz

Then I generated source rpm file:

[makerpm@telesto projects]$ cp tendrl-*tar.gz ~/rpmbuild/SOURCES
[makerpm@telesto projects]$ cp tendrl-dashboard.spec ~/rpmbuild/SPECS
[makerpm@telesto projects]$ cd ~/rpmbuild/SPECS
[makerpm@telesto SPECS]$ rpmbuild -bs tendrl-dashboard.spec

So that I can run mock rpmbuild:

[makerpm@telesto tendrl-dashboard]$ mock -r epel-7-x86_64 ~/rpmbuild/SRPMS/tendrl-dashboard-1.3.0-1.fc25.src.rpm

And all looks good:

$ ls -lh /var/lib/mock/epel-7-x86_64/result
total 97M
-rw-rw-r--. 1 makerpm mock 3.6M May 25 16:09 build.log
-rw-rw-r--. 1 makerpm mock 1.7K May 25 16:07 hw_info.log
-rw-rw-r--. 1 makerpm mock 180K May 25 16:09 root.log
-rw-rw-r--. 1 makerpm mock  839 May 25 16:09 state.log
-rw-rw-r--. 1 makerpm mock 3.7M May 25 16:09 tendrl-dashboard-1.3.0-1.el7.centos.noarch.rpm
-rw-rw-r--. 1 makerpm mock  89M May 25 16:08 tendrl-dashboard-1.3.0-1.el7.centos.src.rpm

I used Fedora 25 with:

$ rpm -q nodejs npm
nodejs-6.10.3-1.fc25.x86_64
npm-3.10.10-1.6.10.3.1.fc25.x86_64
mbukatov commented 7 years ago

One note though, I would expect that both tarballs tendrl-dashboard-1.3.0.tar.gz and tendrl-dashboard-build-pkgs.tar.gz would be released as a part of upstream tendrl release - but as long as all javascript dependencies are specified with full version, it's not totally necessary.