Page 1 of 1

Package Brackets

PostPosted: Dec 1st, '14, 17:33
by egoitzro
I do not know if this is the place to request to create the packages needed to enjoy this software.
Brackets is like Windows or Mac Dreamweaver from Adobe. Is a free open-source editor written in HTML, CSS, and JavaScript with a primary focus on Web Development. It was created by Adobe Systems, licensed under the MIT License.

Brackets source code: https://github.com/adobe/brackets

Re: Package Brackets

PostPosted: Dec 1st, '14, 21:15
by doktor5000
Please report that as a package request, after searching if it hasn't been reported yet already:
https://wiki.mageia.org/en/How_to_repor ... ge_request

Re: Package Brackets

PostPosted: Dec 1st, '14, 23:02
by egoitzro
Thank you.

Re: Package Brackets

PostPosted: Dec 2nd, '14, 00:19
by jkerr82508
It's helpful to quote the bug report number, in case any other forum users are interested in that software and want to comment in the bug report. The best way is to show a direct link to the bug report, like this:
https://bugs.mageia.org/show_bug.cgi?id=14705

Jim

Re: Package Brackets

PostPosted: Dec 2nd, '14, 12:28
by napcok
Brackets rpm package from Fedora works for me in Cauldron. You can find them here -> http://copr-be.cloud.fedoraproject.org/ ... /brackets/

I also tried to build rpm on Cauldron using spec from https://github.com/jgillich/brackets-rpm.
But I have no luck so far.

Re: Package Brackets

PostPosted: Dec 2nd, '14, 13:34
by egoitzro
napcok wrote:Brackets rpm package from Fedora works for me in Cauldron. You can find them here -> http://copr-be.cloud.fedoraproject.org/ ... /brackets/

I also tried to build rpm on Cauldron using spec from https://github.com/jgillich/brackets-rpm.
But I have no luck so far.



Thank you. I'll try it, although dependency issue will always be better if it is packaged for the distro that you use.

Re: Package Brackets

PostPosted: Dec 5th, '14, 00:00
by egoitzro
napcok wrote:Brackets rpm package from Fedora works for me in Cauldron. You can find them here -> http://copr-be.cloud.fedoraproject.org/ ... /brackets/

I also tried to build rpm on Cauldron using spec from https://github.com/jgillich/brackets-rpm.
But I have no luck so far.


Using the spec of the page you mentioned and downloading git code I managed after many attempts to build a rpm package for mageia

Re: Package Brackets

PostPosted: Dec 5th, '14, 16:59
by napcok
egoitzro wrote:Using the spec of the page you mentioned and downloading git code I managed after many attempts to build a rpm package for mageia


Thats good news :)
Can you attach your spec file to bugreport?
Maybe someone from packagers team can look at it then and even import it to official repositories.

Re: Package Brackets

PostPosted: Dec 5th, '14, 23:23
by egoitzro
napcok wrote:
egoitzro wrote:Using the spec of the page you mentioned and downloading git code I managed after many attempts to build a rpm package for mageia


Thats good news :)
Can you attach your spec file to bugreport?
Maybe someone from packagers team can look at it then and even import it to official repositories.


brackets.spec
Code: Select all
Name: brackets
Version: 1.0
Release: 1%{?dist}
Summary: An open source code editor for the web, written in JavaScript, HTML and CSS.
Group: Development/Tools
License: MIT
URL: http://brackets.io/
# The sources for this package were pulled from upstream's vcs.
# Use the fetch_source.sh to download them.
Source0: brackets-shell-%{version}.tar.gz
Source1: brackets-%{version}.tar.gz
Requires: nodejs, gtk2, alsa-lib, GConf2, libgcrypt
BuildRequires: %{requires}, gtk2-devel, npm, nspr, gyp, desktop-file-utils
AutoReqProv: no
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
%description
%prep
%setup -n brackets-shell
%setup -T -D -b 1 -n brackets
%build
%ifarch x86_64
LD_PRELOAD=/usr/lib64/libudev.so.1
%else
LD_PRELOAD=/usr/lib/libudev.so.1
%endif
cd %{_builddir}/brackets
npm install && npm install grunt-cli
./node_modules/.bin/grunt clean less targethtml useminPrepare htmlmin requirejs concat copy usemin
cp -a src/config.json dist/config.json
cd %{_builddir}/brackets-shell
npm install && npm install grunt-cli
./node_modules/.bin/grunt setup full-build
%install
mkdir --parents %{buildroot}%{_datadir}/%{name}
cp -a %{_builddir}/brackets-shell/installer/linux/debian/package-root/opt/brackets/. %{buildroot}%{_datadir}/%{name}
cp -a %{_builddir}/brackets-shell/installer/linux/debian/package-root/usr/share/icons %{buildroot}%{_datadir}/
mkdir --parents %{buildroot}%{_bindir}
ln -sf %{_datadir}/%{name}/brackets %{buildroot}%{_bindir}/%{name}
mkdir --parents %{buildroot}%{_datadir}/applications
cat <<EOT >> %{buildroot}%{_datadir}/applications/%{name}.desktop
[Desktop Entry]
Name=Brackets
Type=Application
Categories=Development
Exec=brackets %U
Icon=brackets
MimeType=text/html;
Keywords=Text;Editor;Write;Web;Development;
EOT
desktop-file-install --mode 0644 %{buildroot}%{_datadir}/applications/%{name}.desktop
%ifarch x86_64
ln -sf /usr/lib64/libudev.so.1 %{buildroot}%{_datadir}/%{name}/libudev.so.0
%else
ln -sf /usr/lib/libudev.so.1 %{buildroot}%{_datadir}/%{name}/libudev.so.0
%endif
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/*/*/*/*.svg
%attr(755, root, root) %{_datadir}/%{name}/brackets
%attr(755, root, root) %{_datadir}/%{name}/Brackets
%attr(755, root, root) %{_datadir}/%{name}/Brackets-node
%attr(755, root, root) %{_bindir}/%{name}
%changelog

Re: Package Brackets

PostPosted: Dec 5th, '14, 23:54
by doktor5000
I've made a few corrections. FWIW, the library Requires on alsa-lib and libgcrypt are not OK, as those should be caught via rpm scanning automatically the required libraries.
Also those hacks regarding libudev.so and finally symlinking it into /usr/share/libudev.so.0 seems pretty wrong.
Although I've not had time to look at it further, just some comments.

egoitzro wrote:
Name: brackets
Version: 1.0
Release: %mkrel 1
Summary: An open source code editor for the web, written in JavaScript, HTML and CSS.
Group: Development/Tools
License: MIT
URL: http://brackets.io/
# The sources for this package were pulled from upstream's vcs.
# Use the fetch_source.sh to download them.
Source0: brackets-shell-%{version}.tar.gz
Source1: brackets-%{version}.tar.gz
Requires: nodejs
Requires: gtk2
Requires: alsa-lib
Requires: GConf2
Requires: libgcrypt
BuildRequires: %{requires}, gtk2-devel, npm, nspr, gyp, desktop-file-utils
AutoReqProv: no

%global __os_install_post /usr/lib/rpm/brp-compress %{nil}

%description
Brackets is an open source code editor for the web, written in JavaScript, HTML and CSS.

%prep
%setup -n brackets-shell
%setup -T -D -b 1 -n brackets
%build
%ifarch x86_64
LD_PRELOAD=/usr/lib64/libudev.so.1
%else
LD_PRELOAD=/usr/lib/libudev.so.1
%endif
cd %{_builddir}/brackets
npm install && npm install grunt-cli
./node_modules/.bin/grunt clean less targethtml useminPrepare htmlmin requirejs concat copy usemin
cp -a src/config.json dist/config.json
cd %{_builddir}/brackets-shell
npm install && npm install grunt-cli
./node_modules/.bin/grunt setup full-build
%install
mkdir --parents %{buildroot}%{_datadir}/%{name}
cp -a %{_builddir}/brackets-shell/installer/linux/debian/package-root/opt/brackets/. %{buildroot}%{_datadir}/%{name}
cp -a %{_builddir}/brackets-shell/installer/linux/debian/package-root/usr/share/icons %{buildroot}%{_datadir}/
mkdir --parents %{buildroot}%{_bindir}
ln -sf %{_datadir}/%{name}/brackets %{buildroot}%{_bindir}/%{name}
mkdir --parents %{buildroot}%{_datadir}/applications
cat <<EOT >> %{buildroot}%{_datadir}/applications/%{name}.desktop
[Desktop Entry]
Name=Brackets
Type=Application
Categories=Development
Exec=brackets %U
Icon=brackets
MimeType=text/html;
Keywords=Text;Editor;Write;Web;Development;
EOT
desktop-file-install --mode 0644 %{buildroot}%{_datadir}/applications/%{name}.desktop
%ifarch x86_64
ln -sf /usr/lib64/libudev.so.1 %{buildroot}%{_datadir}/%{name}/libudev.so.0
%else
ln -sf /usr/lib/libudev.so.1 %{buildroot}%{_datadir}/%{name}/libudev.so.0
%endif

%files
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/*/*/*/*.svg
%attr(755, root, root) %{_datadir}/%{name}/brackets
%attr(755, root, root) %{_datadir}/%{name}/Brackets
%attr(755, root, root) %{_datadir}/%{name}/Brackets-node
%attr(755, root, root) %{_bindir}/%{name}
%changelog
[/code]

Re: Package Brackets

PostPosted: Dec 6th, '14, 01:02
by egoitzro
I have no knowledge to this so the only thing I've done is take the code https://github.com/jgillich/brackets-rp ... ckets.spec and try to make the rpm, maybe I have done wrong, but I built the rpm and it has worked.

Thank you for your corrections and your comments

Re: Package Brackets

PostPosted: Dec 6th, '14, 01:40
by doktor5000
No problem, was not really directed at you :)

Please next time do not use fullquotes, but only use the Reply function. Greatly improves clarity and reading flow ;)

Re: Package Brackets

PostPosted: Dec 6th, '14, 11:24
by egoitzro
OK