Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
b0a75ec1
Commit
b0a75ec1
authored
Apr 25, 2017
by
Francesc Guasch
Browse files
Merge branch 'master' into user_settings
parents
f272ceac
a14f3956
Changes
166
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
b0a75ec1
...
...
@@ -9,3 +9,4 @@ t/etc/ravada_ldap.conf
hypnotoad.pid
log
rvd_front.conf
pkg-debian-out
CHANGELOG.md
View file @
b0a75ec1
...
...
@@ -3,42 +3,15 @@
**Implemented enhancements:**
-
Remove base [
\#
12]
-
New machine parameters [
\#
8]
-
make ping localhost packend faster and lighter [
\#
66]
-
Add a form to rename a virtual machine [
\#
78]
-
Rename domains [
\#
41]
-
Spin off bases from clones [
\#
67]
-
Message to the user when downloading ISO [
\#
77]
-
Name (copy) the cloned domains [
\#
92]
-
Requests for the same domain should queue [
\#
93]
-
Rename domains [
\#
41]
-
Log out the user after starting a new machine [
\#
79]
-
Hide and publish bases [
\#
86]
-
Let the users shutdown their machines from the web [
\#
98]
-
Add iptables rules for the domains [
\#
51]
-
Release information in about page [
\#
62]
-
Disable prepare base button for domains with clones [
\#
89]
-
Start a machine must be prioritary [
\#
97]
-
Ubuntu iso got updated, MD5 check fails [
\#
156]
-
Improve rvd
\_
front security [
\#
180]
-
Redirect admin user to admin machines if no bases [
\#
184]
-
Add support Ubuntu for 17.04 (Zesty) [
\#
187]
**Fixed bugs:**
-
Remove file base entries when removing domain [
\#
80]
-
Remove base button does nothing [
\#
72]
-
Attempted double use of PCI Address [
\#
71]
-
At /machines there is a request for {{machine.id}}.png [
\#
68]
-
Attempted double use of PCI Address [
\#
71]
-
Domains won't start if host IP changes [
\#
84]
-
Make clone volumes unique [
\#
87]
-
Clones of clones crash at start with apparmor error DENIED [
\#
90]
-
Prepare base doesn't send a message when done [
\#
91]
-
Duplicate USB controllers with index 0 [
\#
99]
-
Check USB redirection [
\#
101]
-
The backend dies when mysql is down [
\#
102]
-
message/read/"id".json calls doesnt mark message as read. [
\#
104]
-
When user is logged and fails login form the frontend fails [
\#
73]
-
When user gets logged out it gets access denied [
\#
76]
-
two requests for start try to use open iptables [
\#
81]
-
Skip tests when no VMs available [
\#
63]
-
review KVM add volume [
\#
95]
-
Test failed, prepare failed near "100": syntax error at User.pm [
\#
106]
-
Check if name of new machine already exists [
\#
38]
-
ISO downloading prevents new domains creation [
\#
176]
-
ravada system user was not created on install [
\#
179]
-
Validate new machine name [
\#
188]
-
Fresh install missing virtual networks [
\#
189]
LICENSE
View file @
b0a75ec1
GNU GENERAL PUBLIC LICENSE
Version 3,
2
9
June
2007
GNU
AFFERO
GENERAL PUBLIC LICENSE
Version 3,
1
9
November
2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
...
...
@@ -7,17 +7,15 @@
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU
General Public License
is
intended to guarantee your freedom to
our
General Public License
s are
intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
...
...
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
...
...
@@ -72,7 +60,7 @@ modification follow.
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"This License" refers to version 3 of the GNU
Affero
General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
...
...
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU
Affero
General Public License into a single
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions
will
be similar in spirit to the present version, but may differ in detail to
the GNU
Affero
General Public License from time to time. Such new versions
will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Program specifies that a certain numbered version of the GNU
Affero
General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
GNU
Affero
General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
versions of the GNU
Affero
General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
...
...
@@ -631,44 +629,33 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{
one line to give the program's name and a brief idea of what it does.
}
Copyright (C)
{
year
}
{
name of author
}
<
one line to give the program's name and a brief idea of what it does.
>
Copyright (C)
<
year
>
<
name of author
>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by
the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU
Affero
General Public License as published
by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU
Affero
General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU
Affero
General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
For more information on this, and how to apply and follow the GNU
A
GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
MANIFEST
0 → 100644
View file @
b0a75ec1
etc/rvd_front.conf.example
etc/ravada.conf
etc/xml/jessie-amd64.xml
etc/xml/win8.1-volume.xml
etc/xml/dsl-i386.xml
etc/xml/yakkety64-amd64.xml
etc/xml/dsl-volume.xml
etc/xml/jessie-volume.xml
etc/xml/xenial64-amd64.xml
etc/xml/xenial-volume.xml
etc/xml/swap-volume.xml
etc/xml/win7pro-volume.xml
etc/xml/xenial64-volume.xml
etc/xml/sarah64-volume.xml
etc/xml/jessie-i386.xml
etc/xml/win8.1.xml
etc/xml/trusty-amd64-volume.xml
etc/xml/yakkety64-volume.xml
etc/xml/win7pro.xml
etc/xml/trusty-i386.xml
etc/xml/xenial-i386.xml
etc/xml/trusty-volume.xml
etc/xml/trusty-amd64.xml
etc/xml/default-volume.xml
etc/xml/miniremix-volume.xml
etc/systemd/rvd_front.service
etc/systemd/rvd_back.service
lib/Ravada.pm
lib/Ravada/Request.pm
lib/Ravada/Domain/Void.pm
lib/Ravada/Domain/KVM.pm
lib/Ravada/Domain/Driver.pm
lib/Ravada/Domain/LXC.pm
lib/Ravada/NetInterface/MacVTap.pm
lib/Ravada/NetInterface/Void.pm
lib/Ravada/NetInterface/KVM.pm
lib/Ravada/Front.pm
lib/Ravada/VM.pm
lib/Ravada/Utils.pm
lib/Ravada/I18N.pm
lib/Ravada/VM/Void.pm
lib/Ravada/VM/KVM.pm
lib/Ravada/VM/LXC.pm
lib/Ravada/Auth/SQL.pm
lib/Ravada/Auth/User.pm
lib/Ravada/Auth/LDAP.pm
lib/Ravada/I18N/es.po
lib/Ravada/I18N/fr.po
lib/Ravada/I18N/gl.po
lib/Ravada/I18N/fa.po
lib/Ravada/I18N/en.po
lib/Ravada/I18N/ca.po
lib/Ravada/NetInterface.pm
lib/Ravada/Auth.pm
lib/Ravada/Domain.pm
lib/Ravada/Network.pm
rvd_front.pl
bin/rvd_back.pl
README.md
View file @
b0a75ec1
# ravada [](https://github.com/frankiejol/ravada/releases) [](https://github.com/frankiejol/ravada/blob/master/LICENSE)
# ravada [](https://github.com/frankiejol/ravada/releases) [](https://github.com/frankiejol/ravada/blob/master/LICENSE)
Remo
v
e Virtual Desktops Manager
##
Remo
t
e Virtual Desktops Manager
Broker: ravada
Ravada is a software that allows the user to connect to a
remote virtual desktop.
Hypervisors:
[
KVM
](
http://www.linux-kvm.org/
)
-
[
LXC
](
https://linuxcontainers.org/
)
In the current release we use the
KVM Hypervisors:
[
KVM
](
http://www.linux-kvm.org/
)
as the backend for the Virtual Machines.
[
LXC
](
https://linuxcontainers.org/
)
support is currently in development.
Remote Access:
[
Spice
](
http://www.spice-space.org/
)
### Features
*
KVM backend for Windows and Linux Virtual machines
*
LDAP and SQL authentication
*
Kiosk mode
*
Remote Access with
[
Spice
](
http://www.spice-space.org/
)
for Windows and Linux
*
Light and fast virtual machine clones for each user
*
Instant clone creation
*
USB redirection
*
Easy and customizable end users interface
*
Administration from a web browser
## Install
Read
[
docs/INSTALL.md
](
https://github.com/
frankiejol
/ravada/blob/master/docs/INSTALL.md
)
Read
[
docs/INSTALL.md
](
https://github.com/
UPC
/ravada/blob/master/docs/INSTALL.md
)
Connect to the server with a web browser at http://servername:3000/
### Production
See
[
docs/production.md
](
https://github.com/frankiejol/ravada/blob/master/docs/production.md
)
See
[
docs/production.md
](
https://github.com/UPC/ravada/blob/master/docs/production.md
)
for production fine-tuning guidelines.
### Operation
See
[
docs/operation.md
](
https://github.com/
frankiejol
/ravada/blob/master/docs/operation.md
)
See
[
docs/operation.md
](
https://github.com/
UPC
/ravada/blob/master/docs/operation.md
)
###
Testing
###
Update
See
[
docs/te
st
.md
](
https://github.com/
frankiejol
/ravada/blob/master/docs/te
st
.md
)
See
[
docs/
upda
te.md
](
https://github.com/
UPC
/ravada/blob/master/docs/
upda
te.md
)
bin/rvd_back.pl
View file @
b0a75ec1
...
...
@@ -5,6 +5,7 @@ use strict;
use
lib
'
./lib
';
use
Data::
Dumper
;
use
Getopt::
Long
;
use
Proc::PID::
File
;
...
...
@@ -103,6 +104,14 @@ sub clean_killed_requests {
}
sub
start
{
{
my
$ravada
=
Ravada
->
new
(
config
=>
$FILE_CONFIG
);
$
Ravada::
CONNECTOR
->
dbh
;
for
my
$vm
(
@
{
$ravada
->
vm
})
{
$vm
->
id
;
$vm
->
vm
;
}
}
for
(;;)
{
my
$pid
=
fork
();
die
"
I can't fork $!
"
if
!
defined
$pid
;
...
...
@@ -118,7 +127,7 @@ sub start {
sub
add_user
{
my
$login
=
shift
;
print
"
password
:
";
print
"
$login
password:
";
my
$password
=
<
STDIN
>
;
chomp
$password
;
...
...
@@ -193,5 +202,5 @@ if ($ADD_USER) {
import_domain
(
$IMPORT_DOMAIN
);
exit
;
}
die
"
Already started
"
if
Proc::PID::
File
->
running
();
die
"
Already started
"
if
Proc::PID::
File
->
running
(
name
=>
'
rvd_back
'
);
start
();
copyright
0 → 100644
View file @
b0a75ec1
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ravada
Upstream-Contact: Francesc Guasch <frankie@telecos.upc.edu>
Source: https://github.com/frankiejol/ravada
Files: *
Copyright: 2017 UPC
License: GPL-3
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
deb/debianize.pl
0 → 100755
View file @
b0a75ec1
#!/usr/bin/perl
use
warnings
;
use
strict
;
use
Cwd
qw(getcwd)
;
use
File::
Path
qw(remove_tree make_path)
;
use
IPC::
Run3
;
use
lib
'
./lib
';
use
Ravada
;
use
File::
Copy
;
my
$DIR_DST
=
getcwd
.
"
/../ravada-
"
.
Ravada::
version
();
my
$DEBIAN
=
"
DEBIAN
";
my
%DIR
=
(
templates
=>
'
/usr/share/ravada
'
,'
etc/ravada.conf
'
=>
'
etc
'
,'
etc/xml
'
=>
'
var/lib/ravada
'
,'
docs/
'
=>
'
usr/share/docs/ravada
'
,
sql
=>
'
usr/share/doc/ravada
'
,'
lib/
'
=>
'
usr/share/perl5
'
,'
blib/man3
'
=>
'
usr/share/man
'
,"
debian/
"
=>
"
./DEBIAN
"
,'
etc/systemd/
'
=>
'
lib/systemd/system/
'
);
for
(
qw(css fonts img js )
)
{
$DIR
{"
public/
$_
"}
=
"
usr/share/ravada/public
";
}
my
%FILE
=
(
'
etc/rvd_front.conf.example
'
=>
'
etc/rvd_front.conf
'
,'
bin/rvd_back.pl
'
=>
'
usr/sbin/rvd_back
'
,'
rvd_front.pl
'
=>
'
usr/sbin/rvd_front
'
,'
CHANGELOG.md
'
=>
'
usr/share/doc/ravada/changelog
'
,'
copyright
'
=>
'
usr/share/doc/ravada
'
);
my
@REMOVE
=
qw(
usr/share/ravada/templates/bootstrap/get_authors.sh
usr/share/man/man3/.exists
usr/share/man/man3/Ravada::Domain::LXC.3pm
usr/share/man/man3/Ravada::Domain::Void.3pm
usr/share/man/man3/Ravada::NetInterface::Void.3pm
)
;
########################################################################
sub
clean
{
remove_tree
(
$DIR_DST
);
}
sub
copy_dirs
{
for
my
$src
(
sort
keys
%DIR
)
{
my
$dst
=
"
$DIR_DST
/
$DIR
{
$src
}
";
make_path
(
$dst
)
if
!
-
e
$dst
;
my
(
$in
,
$out
,
$err
);
my
@cmd
=
('
rsync
','
-avL
',
$src
,
$dst
);
run3
(
\
@cmd
,
\
$in
,
\
$out
,
\
$err
);
die
$err
if
$err
;
print
`
chmod go+rx
$dst
`;
}
}
sub
copy_files
{
for
my
$src
(
keys
%FILE
)
{
my
$dst
=
"
$DIR_DST
/
$FILE
{
$src
}
";
my
(
$dir
)
=
$dst
=~
m{(.*)/.*}
;
make_path
(
$dir
)
if
!-
d
$dir
;
mkdir
$dst
if
$dst
=~
m{.*/$}
&&
!
-
e
$dst
;
copy
(
$src
,
$dst
)
or
die
"
$!
$src
->
$dst
";
}
}
sub
remove_not_needed
{
for
my
$file
(
@REMOVE
)
{
$file
=
"
$DIR_DST
/
$file
";
unlink
$file
or
die
"
$!
$file
";
}
for
my
$dir
('
usr/share/doc/ravada/sql/sqlite
')
{
my
$path
=
"
$DIR_DST
/
$dir
";
die
"
Missing
$path
"
if
!
-
e
$path
;
remove_tree
(
$path
);
}
}
sub
create_md5sums
{
my
@files
;
chdir
$DIR_DST
or
die
"
I can't chdir to
$DIR_DST
";
unlink
"
$DEBIAN
/md5sums
";
open
my
$find
,
,'
-|
',
'
find . -type f -printf
\'
%P\n
\'
'
or
die
$!
;
while
(
<
$find
>
)
{
chomp
;
next
if
/^debian/i
;
print
`
md5sum
$_
>>
$DEBIAN
/md5sums
`
}
close
$find
;
chdir
"
..
";
chmod
0644
,"
$DIR_DST
/
$DEBIAN
/md5sums
"
or
die
"
$!
$DIR_DST
/
$DEBIAN
/md5sums
";
}
sub
create_deb
{
my
$deb
=
"
ravada_
${Ravada
::
VERSION}
_all.deb
";
my
@cmd
=
('
dpkg
','
-b
',"
$DIR_DST
/
",
$deb
);
my
(
$in
,
$out
,
$err
);
run3
(
\
@cmd
,
\
$in
,
\
$out
,
\
$err
);
die
$err
if
$err
;
print
"
$deb
created
\n
";
}
sub
remove_use_lib
{
for
my
$file
('
usr/sbin/rvd_front
','
usr/sbin/rvd_back
')
{
my
$path
=
"
$DIR_DST
/
$file
";
die
"
Missing file '
$path
'
"
if
!
-
e
$path
;
copy
(
$path
,
"
$path
.old
")
or
die
"
$!
$path
->
$path
.old
";
open
my
$in
,'
<
',"
$path
.old
"
or
die
"
$!
$path
.old
";
open
my
$out
,'
>
',
$path
or
die
"
$!
$path
";
while
(
<
$in
>
)
{
next
if
/^use lib/
;
print
$out
$_
;
}
close
$out
;
close
$in
;
unlink
"
$path
.old
"
or
die
"
$!
$path
.old
";
chmod
0755
,
$path
or
die
"
$! chmod 755
$path
";
}
}
sub
change_mod
{
for
my
$file
(
'
rvd_front.service
',
'
rvd_back.service
')
{
my
$path
=
"
$DIR_DST
/lib/systemd/system/
$file
";
chmod
0644
,
$path
or
die
"
$!
$path
";
}
}
sub
gzip_docs
{
for
my
$file
(
'
changelog
'
)
{
my
$path
=
"
$DIR_DST
/usr/share/doc/ravada/
$file
";
die
"
Missing
$path
\n
"
if
!-
e
$path
;
print
`
gzip -n -9
$path
`;
}
}
sub
gzip_man
{
my
$dir
=
"
$DIR_DST
/usr/share/man/man3
"
;
opendir
my
$ls
,
$dir
or
die
"
$!
$dir
";
while
(
my
$file
=
readdir
$ls
)
{
next
if
!
-
f
"
$dir
/
$file
";
print
`
gzip -n -9
$dir
/
$file
`;
}
closedir
$ls
;
}
sub
chown_files
{
my
$dir
=
shift
;
my
$file_perm
=
(
shift
or
0644
);
my
$dir_perm
=
(
shift
or
0755
);
my
$deb_dir
=
"
$DIR_DST
/
$dir
";
chmod
(
$dir_perm
,
$deb_dir
)
or
die
"
$!
$deb_dir
";
chown
(
0
,
0
,
$deb_dir
)
or
die
"
$!
$deb_dir
";
return
if
!
-
d
$deb_dir
;
opendir
my
$ls
,
$deb_dir
or
die
"
$!
$deb_dir
";
while
(
my
$file
=
readdir
$ls
)
{
next
if
$file
=~
m{^\.}
;
my
$path
=
"
$deb_dir
/
$file
";
die
"
Missing
$path
"
if
!
-
e
$path
;
chown
(
0
,
0
,
$path
)
or
die
"
$!
$path
";
if
(
-
f
$path
)
{
chmod
(
$file_perm
,
$path
)
or
die
"
$!
$path
";
# printf("chmod %o $path\n",$file_perm);
}
chown_files
("
$dir
/
$file
")
if
-
d
$path
;
}
closedir
$ls
;
}
sub
chown_pms
{
print
`
find
$DIR_DST
/ -iname "*pm" -exec chmod 755 {}
\\
;
`;
print
`
find
$DIR_DST
/usr/share -iname "*po" -exec chmod 755 {}
\\
;
`;
}
sub
chmod_control_files
{
for
(
qw(control conffiles)
)
{