Commit graph

1608 commits

Author SHA1 Message Date
Joel Goguen
1c25ba0042 Exclude execute from umask
If the umask is set up to exlude execute, the installer will set up
calibre to be unreadable by any user other than the installing user.
When installing as `root`, a starting umask of `0o077` results in the
installer choosing a new umask of `0o033`, which means the calibre
install directory (and child directories) are installed with permissions
`0o744`, so only the installing user can actually use the resulting
calibre install.

To test, start with a system umask of `0o077` and run the installer
script as root:

```
% sudo sh ./setup/linux-installer.sh
Using python executable: /usr/bin/python3
WARNING: Your current umask disallows reading of files by some users, this can cause system breakage when running the installer because of bugs in common system utilities.
Should the installer (f)ix the umask, (i)gnore it or (a)bort [f/i/a Default is abort]: f
umask changed to: 022
Installing to /opt/calibre
Downloading tarball signature securely...
Using previously downloaded calibre-3.26.1-x86_64.txz
Extracting files to /opt/calibre ...
Extracting application files...
Creating symlinks...
	Symlinking /opt/calibre/ebook-edit to /usr/bin/ebook-edit
	Symlinking /opt/calibre/calibre-debug to /usr/bin/calibre-debug
	Symlinking /opt/calibre/web2disk to /usr/bin/web2disk
	Symlinking /opt/calibre/calibre-parallel to /usr/bin/calibre-parallel
	Symlinking /opt/calibre/calibredb to /usr/bin/calibredb
	Symlinking /opt/calibre/lrs2lrf to /usr/bin/lrs2lrf
	Symlinking /opt/calibre/calibre to /usr/bin/calibre
	Symlinking /opt/calibre/ebook-convert to /usr/bin/ebook-convert
	Symlinking /opt/calibre/calibre-server to /usr/bin/calibre-server
	Symlinking /opt/calibre/ebook-viewer to /usr/bin/ebook-viewer
	Symlinking /opt/calibre/calibre-smtp to /usr/bin/calibre-smtp
	Symlinking /opt/calibre/ebook-meta to /usr/bin/ebook-meta
	Symlinking /opt/calibre/ebook-device to /usr/bin/ebook-device
	Symlinking /opt/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
	Symlinking /opt/calibre/ebook-polish to /usr/bin/ebook-polish
	Symlinking /opt/calibre/lrfviewer to /usr/bin/lrfviewer
	Symlinking /opt/calibre/calibre-customize to /usr/bin/calibre-customize
	Symlinking /opt/calibre/lrf2lrs to /usr/bin/lrf2lrs
	Symlinking /opt/calibre/markdown-calibre to /usr/bin/markdown-calibre
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/site-functions/_calibre
Installing bash completion to: /usr/share/bash-completion/completions/calibre
Setting up desktop integration...
Creating un-installer: /usr/bin/calibre-uninstall
Run "calibre" to start calibre
```

And the resulting directory:
```
% ls -ld /opt/calibre
drwxr-xr-x. 5 root root 4.0K Jun 22 10:53 /opt/calibre/
```

Also verify the Python version, starting with no `/opt/calibre` and a system umask of `0o077`:
```
% sudo python3 ./setup/linux-installer.py
WARNING: Your current umask disallows reading of files by some users, this can cause system breakage when running the installer because of bugs in common system utilities.
Should the installer (f)ix the umask, (i)gnore it or (a)bort [f/i/a Default is abort]: f
umask changed to: 022
Installing to /opt/calibre
Downloading tarball signature securely...
Using previously downloaded calibre-3.26.1-x86_64.txz
Extracting files to /opt/calibre ...
Extracting application files...
Creating symlinks...
	Symlinking /opt/calibre/calibre-customize to /usr/bin/calibre-customize
	Symlinking /opt/calibre/calibre-smtp to /usr/bin/calibre-smtp
	Symlinking /opt/calibre/calibredb to /usr/bin/calibredb
	Symlinking /opt/calibre/calibre to /usr/bin/calibre
	Symlinking /opt/calibre/ebook-polish to /usr/bin/ebook-polish
	Symlinking /opt/calibre/ebook-meta to /usr/bin/ebook-meta
	Symlinking /opt/calibre/calibre-server to /usr/bin/calibre-server
	Symlinking /opt/calibre/markdown-calibre to /usr/bin/markdown-calibre
	Symlinking /opt/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
	Symlinking /opt/calibre/lrf2lrs to /usr/bin/lrf2lrs
	Symlinking /opt/calibre/calibre-parallel to /usr/bin/calibre-parallel
	Symlinking /opt/calibre/ebook-convert to /usr/bin/ebook-convert
	Symlinking /opt/calibre/ebook-viewer to /usr/bin/ebook-viewer
	Symlinking /opt/calibre/web2disk to /usr/bin/web2disk
	Symlinking /opt/calibre/calibre-debug to /usr/bin/calibre-debug
	Symlinking /opt/calibre/ebook-device to /usr/bin/ebook-device
	Symlinking /opt/calibre/lrfviewer to /usr/bin/lrfviewer
	Symlinking /opt/calibre/ebook-edit to /usr/bin/ebook-edit
	Symlinking /opt/calibre/lrs2lrf to /usr/bin/lrs2lrf
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/site-functions/_calibre
Installing bash completion to: /usr/share/bash-completion/completions/calibre
Setting up desktop integration...
Creating un-installer: /usr/bin/calibre-uninstall
Run "calibre" to start calibre

% ls -ld /opt/calibre
drwxr-xr-x. 5 root root 4.0K Jun 22 10:55 /opt/calibre/
```

After each, verify calibre starts as a non-root user.
2018-06-22 10:49:26 -07:00
Kovid Goyal
4df998fdd2
Ignore 404s on private bugs 2018-06-18 13:24:33 +05:30
Kovid Goyal
e8fdd7a83c
Migrate git hooks to py3 2018-06-12 18:01:55 +05:30
Kovid Goyal
cd7e8891bd
Fix python invocation in git hooks 2018-06-10 07:33:54 +05:30
Kovid Goyal
73029303d6
Dont use a set literal in the installer since there are apparently people still running linux installations with python 2.6 2018-06-09 07:05:03 +05:30
Kovid Goyal
499578beaa
Try to get unicode_names compiling on ancient compilers 2018-05-01 11:31:21 +05:30
Kovid Goyal
eaffdbb884
... 2018-05-01 11:18:40 +05:30
Kovid Goyal
5d95d13935
Edit Book: Fix names for some control characters not being displayed in the status bar
Uses the unicode names database I created for kitty. Much more
comprehensive than the one in ICU.
2018-05-01 10:23:50 +05:30
Kovid Goyal
f04b5eea20
Remove use of command -v from linux-installer.sh 2018-04-30 08:29:59 +05:30
Kovid Goyal
7a150c065e
Add a shebang for linux-installer.sh 2018-04-29 15:11:46 +05:30
Kovid Goyal
54c81eec15
Simplify passing arguments to linux-installer.py 2018-04-29 14:57:59 +05:30
Kovid Goyal
db936049cd
Add a shell script wrapper for the linux installer
Needed because Ubuntu 18.04 has decided, in its infinite wisdom to
have no default python executable, which makes it impossible to run
polyglot python scripts.
2018-04-28 10:05:18 +05:30
Kovid Goyal
9679a1c4f3
pep8 2018-04-28 08:52:46 +05:30
Kovid Goyal
2373a38005
Linux installer: Fix umask question not working with the recommended install command because stdin is a pipe 2018-04-14 15:44:02 +05:30
Kovid Goyal
baee2d2546
Content server: When updating interface data do not transmit translations if they have not been changed. Saves ~30-60KB bandwidth when using non-English interface language. 2018-03-24 10:50:24 +05:30
Kovid Goyal
73cd57bebb
DRYer 2018-03-10 09:07:38 +05:30
Kovid Goyal
53e5d1a748
Fix #1754698 [SIP_DIR no longer works to specify pyqt_sip_dir](https://bugs.launchpad.net/calibre/+bug/1754698) 2018-03-10 09:04:54 +05:30
Kovid Goyal
2beeb537b4
Ensure no spaces around fosshub API key 2018-03-09 16:41:00 +05:30
Kovid Goyal
5697f8f282
More robust timeout retry handling 2018-02-02 15:43:55 +05:30
Kovid Goyal
3dfd846b7b
Retry after sleeping on URL fetch timeout in plugins mirror script 2018-02-02 13:14:04 +05:30
Kovid Goyal
594c52a7af
Double plugin mirror download timeout 2018-02-01 13:06:34 +05:30
Kovid Goyal
3f9c5a8719
Move the search query parser tests into their own module and integrate with the calibre testing system 2018-01-18 10:03:30 +05:30
Kovid Goyal
5ac2ae511f
Also check for the C1 control chars 2018-01-05 12:35:51 +05:30
Kovid Goyal
0053ee6456
Add a check for ASCII control codes in translation files 2018-01-05 12:31:57 +05:30
Conrad Meyer
712edec636 Compatibility improvements for FreeBSD systems
Don't exclude libmtp on FreeBSD systems.

Don't exclude libusb on FreeBSD systems.  Our libusb has a different include
path structure and libname than Linux, but compiles fine once those are
corrected.

Correct path to py-sip on FreeBSD.  We install it to a different directory
than build_environment.py was looking in.
2017-12-26 13:01:13 -08:00
Kovid Goyal
631ca6393e
Linux installer: A nicer error message if the user tries to run the installer on an ARM machine 2017-12-04 12:32:36 +05:30
Kovid Goyal
b6312f1f12
Move various win API calls into native code
Faster, more robust. Should fix #1728196
2017-10-28 13:07:38 +05:30
Kovid Goyal
09d25c21e8
Update website translations on publish 2017-08-24 10:35:08 +05:30
Kovid Goyal
31e693cd09
Reduce the threshold for website translations to be included 2017-08-24 00:18:46 +05:30
Kovid Goyal
b6ef1092ce
Also write lang names to website locales zip file 2017-08-23 10:57:21 +05:30
Kovid Goyal
d554fbeb81
Compile the website translations 2017-08-23 09:46:27 +05:30
Kovid Goyal
f6b8381018
Ensure build is run before publish proceeds 2017-08-04 08:57:08 +05:30
Kovid Goyal
dfe2f5e04f
Dont use installed calibre when running sphinx-build 2017-07-04 21:51:42 +05:30
Kovid Goyal
9ccbf1ef8f
... 2017-07-04 17:54:22 +05:30
Kovid Goyal
81460e6cfc
More robust parallel use of sphinx-build2 2017-07-04 17:52:49 +05:30
Kovid Goyal
a0ac9cfddb
Use calibre available languages not manual languages when generating man pages 2017-07-04 13:19:20 +05:30
Kovid Goyal
556c32b6b8
Add man pages to the source tarball 2017-07-04 13:06:33 +05:30
Kovid Goyal
fa191ab55a
Create a setup.py command: man_pages to generate man pages in all languages 2017-07-04 12:28:59 +05:30
Kovid Goyal
9f4bf26b9d
Dont mute curl on the unix ci server 2017-07-02 10:17:46 +05:30
Kovid Goyal
9768d16334
Forgot that on macOS qmake generates .dylib files 2017-06-26 16:20:53 +05:30
Kovid Goyal
2291b2d2a0
Build the headless QPA backend on macOS as well 2017-06-26 14:56:58 +05:30
Kovid Goyal
7de2e366cf
A spot of refactoring 2017-06-22 09:00:49 +05:30
Kovid Goyal
cad405d413
Make the Support calibre button in the User manual translateable 2017-06-21 00:08:23 +05:30
Kovid Goyal
af6d043375
Switch to using msgfmt to check for format errors in translated strings
It catches more than pofilter with fewer false positives.
2017-06-18 10:26:24 +05:30
Kovid Goyal
08308ee14d
Fix python brace format check not being done by pofilter 2017-06-17 18:39:41 +05:30
Kovid Goyal
d305656bb4
Remove the vendored unrar code 2017-06-17 13:56:37 +05:30
Kovid Goyal
346b3b4368
Extarct strings from the calibre website for translation 2017-06-12 11:48:23 +05:30
Kovid Goyal
f863d3b46a
Try using node+rapydscript on appveyor as well 2017-06-10 11:22:17 +05:30
Kovid Goyal
858b21dadf
See if installing uglify-js manually fixes Travis builds 2017-06-09 20:31:32 +05:30
Kovid Goyal
2c80dc2aed
Remove orphaned compiled forms when switching branches 2017-06-09 00:21:10 +05:30
Kovid Goyal
9564c94ad1
Remove the copy of dukpy. Make it an external dependency. 2017-06-07 15:07:19 +05:30
Kovid Goyal
aee8af31f3
Hide all symbols in the compiled python extensions on unix
They were already hidden on windows. Avoids the possibility of symbol
collisions and also means ld has to do less work when loading them
extensions.
2017-06-07 12:19:24 +05:30
Kovid Goyal
0ece679a1b
No longer bundle python-regex 2017-05-27 10:39:25 +05:30
Kovid Goyal
802b1ab1e9
Enable CI for win 32bit as well 2017-05-24 21:38:04 +05:30
Kovid Goyal
c9839063d4
Remove obsolete reference to vs2015 2017-05-21 13:52:50 +05:30
Kovid Goyal
71c1232fa4
Ensure multitail building does not assume tty 2017-05-21 13:39:32 +05:30
Kovid Goyal
50ae40a73f
DRYer 2017-05-21 13:39:32 +05:30
Kovid Goyal
0ac375742e
Ensure index-generated.html is built correctly before publishing betas 2017-05-21 13:39:31 +05:30
Kovid Goyal
547b0ce83c
Port CI script changes from master 2017-05-21 13:39:30 +05:30
Kovid Goyal
8246e539bc
Retry sw download on appveyor 2017-05-21 13:39:30 +05:30
Kovid Goyal
fbefbc57cc
Remove workaround for QTBUG-42281 2017-05-21 13:39:30 +05:30
Kovid Goyal
c7d4af9ab7
Update publish_betas command 2017-05-21 13:39:29 +05:30
Kovid Goyal
a7e7b0d381
pep8 2017-05-21 13:39:29 +05:30
Kovid Goyal
e8371dc78a
... 2017-05-21 13:39:26 +05:30
Kovid Goyal
0fdf23de8b
Simplify windows exclusive file implementation by using msvcrt.locking as a fcntl substitute 2017-05-21 13:39:26 +05:30
Kovid Goyal
02aa7f1be0
Remove library.cli completely 2017-05-21 13:39:23 +05:30
Kovid Goyal
933c7d221d
pep8 and condition on PLATFORM 2017-05-21 13:39:10 +05:30
Kovid Goyal
00ef575a03
No longer need to restrict running kernel as we use chroot 2017-05-21 13:39:10 +05:30
Kovid Goyal
9445fae589
build-calibre dir layout changed slightly 2017-05-21 13:39:10 +05:30
Kovid Goyal
063c43e871
Call shutdown after linux build as well 2017-05-21 13:39:10 +05:30
Kovid Goyal
e21f0a3acc
Dont error if file exists when building installer 2017-05-21 13:39:10 +05:30
Kovid Goyal
e49df95bac
Add a kernel version check to the publish command
The new build process uses docker which requires installed and running
kernel versions to match
2017-05-21 13:39:09 +05:30
Kovid Goyal
74153a0d22
Sign installers explicitly 2017-05-21 13:39:09 +05:30
Kovid Goyal
dda2541a30
Remove unused code 2017-05-21 13:39:09 +05:30
Kovid Goyal
4488703e1e
Start work on setting up CO testing on windows with AppVeyor 2017-05-21 13:39:09 +05:30
Kovid Goyal
37cd0c56e5
Use the new auto-build infrastructure for creating calibre installers 2017-05-21 13:39:09 +05:30
Kovid Goyal
7bce30a9db
Change windows build environment detection to work with the new automatic build system 2017-05-21 13:39:08 +05:30
Kovid Goyal
4c3d3ecae8
Run the tests before publishing 2017-05-21 13:39:08 +05:30
Kovid Goyal
523bf9f4eb
... 2017-05-21 13:39:08 +05:30
Kovid Goyal
c203b2fcd4
Remove extraneous fluff from the dist directory 2017-05-21 13:39:08 +05:30
Kovid Goyal
ed1caccac7
Fix bundled Universal CRT not working on computers where the Universal CRT was not already installed 2017-05-21 13:39:08 +05:30
Kovid Goyal
107c454cb2
Simplify code to set dll directory 2017-05-21 13:39:08 +05:30
Kovid Goyal
ac019c2460
Dont create installers in build notes 2017-05-21 13:39:08 +05:30
Kovid Goyal
c929839f14
... 2017-05-21 13:39:08 +05:30
Kovid Goyal
6c353bd330
... 2017-05-21 13:39:08 +05:30
Kovid Goyal
d337aee373
Disable app-local deployment of the universal CRT
It does not work for some hard to fathom reason.
2017-05-21 13:39:07 +05:30
Kovid Goyal
963b0eeea6
Nicer error message when loading the Universal CRT fails 2017-05-21 13:39:07 +05:30
Kovid Goyal
897a1a137e
Do not have the launcher executables depend on the CRT 2017-05-21 13:39:07 +05:30
Kovid Goyal
f8560f79fc
Add proper manifests to all calibre executables
Marked as compatible with all versions of windows upto 10
2017-05-21 13:39:07 +05:30
Kovid Goyal
ef7c1a3c69
Fix detection of mt.exe 2017-05-21 13:39:07 +05:30
Kovid Goyal
2f7f2ace66
Change the VM names 2017-05-21 13:39:07 +05:30
Kovid Goyal
9b5a3ba5a5
Build 32bit calibre 2017-05-21 13:39:07 +05:30
Kovid Goyal
1dd2c65384
Build libimobiledevice 2017-05-21 13:39:07 +05:30
Kovid Goyal
9bd640e7ae
Replace the old windows build notes 2017-05-21 13:39:07 +05:30
Kovid Goyal
645f1d138f
Option to not build installers 2017-05-21 13:39:06 +05:30
Kovid Goyal
3565840a07
Update path to WiX 2017-05-21 13:39:06 +05:30
Kovid Goyal
e3d0d6e23a
Add CRT to the frozen build 2017-05-21 13:39:06 +05:30
Kovid Goyal
ab3e048a95
Use only win32 functions in the launcher, no CRT functions
Reduces the size of the executables a little
2017-05-21 13:39:06 +05:30
Kovid Goyal
9a49104dac
Refactor application layout on windows
Now only the calibre executables are present in the top level directory
(which is added to PATH). No third party executables and no dlls.

This became necessary because the VS 2015 CRT is not manifest based, so
it would have to be placed in the top level dir in the old layout. Now
it can be put into the DLLs dir.
2017-05-21 13:39:06 +05:30
Kovid Goyal
77a0558cf2
Initial stab at replacing use of MemoryModule 2017-05-21 13:39:06 +05:30